jquery

Javascript: why does this produce and ugly string??? I would like currency

var total = 0; $(".amount").each(function() { var value = $(this).val(); value = (value.length < 1) ? 0 : value; var tmp = parseFloat(value).toFixed(2); total += tmp; }); $(".total").text(total); I am trying to loop through some text boxes and sum up their values....

Clone object is not droppable

I'm trying to clone a droppable object using Jquery but the cloned object is not droppable. $(document).ready(function(){ $("input[value='Add']").click(function(e){ e.preventDefault(); $("div.field:last").clone().insertAfter("div.field:last"); }); $(".field").droppable(); HTML <div class="field"> Last Name<input type="text" value=...

In need of help - - Total of rows and columns of a table

Found the answer. Take a look if you're interested. Changed my approach to completing this project. Need to be able to calculate rows to "Total" on the right hand side and the columns to "Daily Totals" I've been able to get some of it working, but it's screwy with the calculations and can't be right. Grand total seems to be working,...

Newbie: What does jQuery.ajaxSetup 'beforeSend' do?

I'm using this in a Rails app. and I have some code that changes the response type to javascript. jQuery.ajaxSetup({ 'beforeSend': function(xhr) { xhr.setRequestHeader("Accept", "text/javascript") } }) This works fine when submitting a form, but it doesn't seem to be called when submitting the javascript form generated...

Why does my JavaScript / jQuery interaction with a child window raise a "permission denied" error?

I have some code that I would swear was working a month ago. However, now the code throws a permission denied to get property Window.jQuery error. I can see this error in the Firefox error console. The code in question belongs to a window that was opened via JavaScript. This code attempt to update the contents of a DIV in the opening ...

JQuery - Add css class to List

I have the following HTML : <li> <a class="meuble-tab" href="#">Meuble</a> </li> i need to achieve the following: <li class="active"> <a class="meuble-tab" href="#">Meuble</a> </li> Using Jquery I am at the point where i can get to the $(".meuble-tab") How do I get to its parent "li" to do the addClass("active")? ...

Can someone please Help with this Jquery code

Hi: I have been trying to get this code to work for a while now and cannot figure out what is wrong. It is for a tri state rollover with images. (I know that I can do this with CSS so please do not answer with that.) The goal is, I am trying to learn jquery and as part of the learning I am trying to figure out what I am missing here. ...

jQuery opacity on hover

Please, help to rewrite this jQuery function: $(".gallery dt a img").fadeTo("fast", .7); $(".gallery dt a").hover(function () { $(this).fadeTo("fast", 1) }, function () { $(this).fadeTo("fast", .7) }); Here is a html: <dl class="gallery"> <dt><a href="#"><img /></a></dt> <dd><a href="#">text</a></dd> </dl> Image app...

How do I get the value of td using hierarchy?

<tr> <td>#</td> <td>2009</td> <td><a class="delete_this">Click</a></td> </tr> I want to use jquery and get the text of 2nd (second) "td" when clicking the anchor. I want the "td" in the same tr as the anchor... How do I do this? So far I have $(document).ready(function(){ $(".delete_this').click(function(){ var myNUmber = $...

Implementing client-side ajax login, is it safe to logout using ajax or do I need to refresh?

I'm building a client-side ajax login for Asp.Net MVC by doing jquery posts to the controller to log in the user. What I'm wondering is when the user goes to log out, should the page refresh? (for security reasons) This tutorial here says: There will always be a page refresh on logout. This is necessary to ensure that any user...

How can I get class-based objects in JavaScript with jQuery?

I'm trying to move from Prototype to jQuery and there's one last thing I can't figure out how to do in the new library. Here's what I used to do with Prototype: MyClass = Class.create(); MyClass.prototype = { initialize: function(options) { } } Then I could create a new MyClass with: var mc = new MyClass({}); Does jQuery have...

Unable to communicate with Javascript from Flex after dymanically loading a swf.

Hi, for some reason, whenever I dynamically load a swf on a $(document).ready() by writing to a div, I am unable to make javascript calls to the browser. Specifically, all calls to the browser return "null". This does not occur when embedding the swf normally on the page load, but I would like to prevent loading of the swf until a specif...

jquery -> frame item not defined

Have the following function business_name(Bname) { alert(Bname); $.frameReady(function(){$("<b>"+Bname+"</b>").prependTo("#name");},"top.iFrame"); } I get the Bname alert but the the function fails with fire bug saying Bname is not defined. Why is that? ...

Grab File Upload ASP Object Textbox Text with jQuery

I have a webform that has an ASP file upload object and I want to use jQuery to grab the file they have selected and upload the file via AJAX. However I am having problems grabbing the file name after it's been selected. Here is the HTML/ASP Code: <asp:FileUpload runat="server" ID="NewPic" /> <asp:RequiredFieldValidator ID="Requir...

Localization with JQuery?

I have no idea how to handle localization with JQuery. I want to set an innerHTML with German text, but if the browser is configured to use English, then I want to set English text. In PHP I use gettext for such stuff, but how to do it in JavaScript/jQuery? ...

jquery Autocomplete - passing additional option value from form

I have 2 selectable option values for a keywords field ie Search for Keywords Option(int)1 or Name. option int(2) I need to pass this addition option value along with the $q query to the search form. How do i do this? Thanks ...

can we run javascript in .net window application

hi I am developing a application in which i want to show pop up and loading image . for this i need to use jquery can it possible to run these script in .net window application form as iam not using asp .net . ...

how can I make a div stick to the top of the screen once it's been scrolled to?

I would like to create a div, that is situated beneath a block of content but that once the page has been scrolled enough to contact its top boundary, becomes fixed in place and scrolls with the page. I know I've seen at least one example of this online but I cannot remember it for the life of me. Any thoughts? ...

Jquery Passing checkbox values

Im trying to get the selected value of a 2 radio options (1 & 2) and pass it into a auto complete extraParams: value so far i have this extraParams: { search_option: $('input[name=search_option]:checked').val() }, problem is if the radio is changes the value is not updated. Any ideas as how i can do this Thanks ...

How can I update the text in a loaded SWF file with javascript/AS3?

I need to build a live preview in Flash which will show a user a customised version of a product - for example with their own text on the site. I don't use Flash normally but understand a little bit of Actionscript 3. I am using jQuery to embed and communicate with my SWF. I have a SWF movie to which I am passing an initial value via ...