jquery

jQuery: selecting checked checkbox

Suppose I have the following HTML: <form id="myform"> <input type='checkbox' name='foo[]'/> Check 1<br/> <input type='checkbox' name='foo[]' checked='true'/> Check 2<br/> <input type='checkbox' name='foo[]'/> Check 3<br/> </form> Now, how do I select the checked input fields with name 'foo[]'? This is my try, but it doesn't work: $('...

How does $(document).ready() work in IE 8?

I've recently installed IE 8 and can't seem to get the jquery $(document).ready event to fire. Are there any special considerations that I'm missing? Litterally, this is all I have in my html and it works as expected in Chrome and Firefox: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1...

Using live() - benefits - similar to bind()

Hey, I have been doing some reading up on jquery live event and am still kind of confused? What is the benefit to using it? http://docs.jquery.com/Events/live I know it is similar to bind but both of those events still seem off to me. Just looking for some pointers. Thanks, Ryan ...

jquery fade effect not working in FF

This piece of code fades the div fine in IE. In Firefox 3.0.8, the fade time goes by and the div disappears instantly. I can't find anyone mentioning this problem. $(function() { $("#show").click(function() { $("#show").fadeOut('slow'); }); }); <div id="show">this is where to show i...

passing a jquery object into a function.

How would you do something like this: somemethod($("#buttonelement")); function(ele) { ele.click(function(event) { alert("hi"); }); } in other words how do you pass in an element as a jquery object and register the click event. ...

JQuery and invisible select - JQuery

I have a select checkbox that has invisible set to false. ASPX looks like this: <input name="selGR" id="selGR" type="checkbox" checked="checked" visible="false" runat="server" fieldname="GR"/> The select box is not even rendered in the HTML which explains why JQuery is not finding it. Is there a way around this? EDIT: Setting style w...

Getting the current src of an Iframe using JQuery

I need to get notified whenever a user clicks a link on a page in an iframe that is not from the same doamin. I'm aware of xss restrictions, however all i need to know is the current page being served in the Iframe. Is there a way to do this without violating xss rules? ...

How to get all element parents using jquery?

How to get all element parents using jquery? i want to save these parents in a variable so i can use later as a selector. such as <div><a><img id="myImg"/></a></div> GetParents('myImg'); will return "div a" something like that ...

BindAsEventListener equivalent in jQuery?

I am trying to bind a click event to some element using jQuery. Using prototype I know I can do this using BindAsEventListener(). Example: var myObject = { init: function(txtOneId, txtTwoId, lblResultId, ancAddId) { this.txtOneId = txtOneId; this.txtTwoId = txtTwoId; this.lblResultId = lblResultId; this.ancAddId = an...

Get top href and innerHTML from within an iframe

Is there any way to grab any information from the top from within an iframe on a separate domain? Somebody has tasked me with validating that their advertising is not next to things like pornography, etc... but their ads are always inside an iframe on publisher sites. Interestingly, when I put twitter.com in an iframe, they have iframe...

jQuery map vs. each

In jQuery, the map and each functions seem to do the same thing. Are there any practical differences between the two? When would you choose to use one instead of the other? ...

DOM Navigation with JQuery in ASP.Net

I've written the JQuery below, and have had to search for items in the DOM using multiple calls to .parent() because the ClientIDs rendered in ASP.Net are built up dynamically in the html. I'm aware that this will cause problems each time we change the markup code, and would like to see if anyone knows of a better way to do this in ASP....

JQuery selector for inline style property

I would like to use a jquery to select the following span: <span id="RequiredFieldValidator1" class="validationerror" style="color: Red; display: none;">*</span> But not select the following span which differs from the original in that the style attribute has a display property whose value is inline instead of none. <span id="Require...

Unable to show only one drawer by jQuery at startup

I want only one drawer to be open at startup. At the moment, all drawers are open. The jQuery code $(document).ready(function () { // hide all ULs inside LI.drawer except the first one $('LI.drawer UL:not(:first)').hide(); // apply the open class $('li.drawer:first ul').addClass('open'); $('h2.drawer-handle').cli...

Show a javascript loader image while function is executing

I want to click a button, show a loader image, execute a time-consuming function, hide the loader image. When I attempt this, the page freezes until the entire event runs, so the loader image is never seen. Here is a sample: $('#btn').click(function() { $('#LoadingImage').show(); <time consuming function> $('#LoadingImage'...

jQuery samples

Hi, one of these days I came across one of those very long scrolling pages with several great jQuery samples: calendars, sliders, collpsible menus etc. I am googling like crazy to find it again but I haven't been successful, although there are lots of jQuery examples. This website I am talking about (ouch, I don't know its name) has the ...

jQuery + Safari 4 Beta

I have a (ASP.NET MVC) site that uses jQuery 1.3.2 and my jQuery functions refuse to invoke on Safari 4.0 beta [mac]. I CAN get them to invoke if I change the user-agent to Safari 3.2.1 Mac. This seems strange to me as I can't find any info about jQuery having issues with the beta and I don't know why the user-agent would change that. ...

jQuery Execution?

My jQuery script has a glitch animating a div position. The bug seems to occur when I click the link right as the page is loading. ...

change event on a table fails in IE

I am using jQuery to capture a change event on a table. The table has many rows and each row has a few inputs boxes and a checkbox. To do this, I am using event delegation. I am capturing any changes at the tbody level. This is the code below $j('#orderItems tbody').change(function(event){ var target = $j(event.target); ...

Mutilple javascript variable iterations with jquery

i have a form and would like to give users the ability to duplicate a group of fields as many times as necessary. With one group it iterates correctly but when I add a second group the "current" variable iterates collectively instead of being unique to each group... i tried changing all of the "current" to "newFieldset.current" but that ...