jquery

jQuery: Can you select by CSS rule, not class?

A .container can contain many .components, and .components themselves can contain .containers (which in turn can contain .components etc. etc.) Given code like this: $(".container .component").each(function() { $(".container", this).css('border', '1px solid #f00'); }); What do I need to add to the line within the braces to select...

Where can I download the jQuery API documentation?

Since I pound API docs pretty hard when I'm coding, I like to have them on my local disk. jQuery.com lists a lot of sources for browsing the API documentation online, but I haven't found anywhere I can download an HTML bundle as a TAR or ZIP file. Is such a bundle available? EDIT: I should have said that I want an HTML version. UPDATE:...

Is there any way to repopulate an Html Select's Options without firing the Change event (using jQuery)?

I have multiple selects: <select id="one"> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select> <select id="two"> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select> What I want is to select "one" from the first select,...

A problem with the jquery dialog when using the themeroller css

Hello, The demos for the jquery ui dialog all use the "flora" theme. I wanted a customized theme, so I used the themeroller to generate a css file. When I used it, everything seemed to be working fine, but later I found that I can't control any input element contained in the dialog (i.e, can't type into a text field, can't check checkb...

What is the most efficient way to sort an Html Select's Options by value, while preserving the currently selected item?

I have jQuery but I'm not sure if it has any built-in sorting helpers. I could make a 2d array of each item's text, value, and selected properties, but I don't think that javascript's built in Array.sort() would work correctly. ...

What is the best approach for (client-side) disabling of a submit button?

Details: Only disable after user clicks the submit button, but before the posting back to the server ASP.NET Webforms (.NET 1.1) Prefer jQuery (if any library at all) Must be enabled if form reloads (i.e. credit card failed) This isn't a necessity that I do this, but if there is a simple way to do it without having to change too much...

Good ways to improve jQuery selector performance?

I'm looking for any way that I can improve the selector performance of a jQuery call. Specifically things like this: Is $("div.myclass") faster than $(".myclass") I would think it might be, but I don't know if jQuery is smart enough to limit the search by tag name first, etc. Anyone have any ideas for how to formulate a jQuery select...

How to encrypt email addresses using JQuery

Is there a way to use JQuery to cloak or encrypt email addresses on an HTML page without changing the syntax in the HREF? ...

Using JQuery, what is the best way to set onclick event listeners for radio buttons?

For the following HTML: <form name="myForm"> <label>One<input name="area" type="radio" value="S" /></label> <label>Two<input name="area" type="radio" value="R" /></label> <label>Three<input name="area" type="radio" value="O" /></label> <label>Four<input name="area" type="radio" value="U" /></label> </form> Changing from the...

Using core JQuery, how do you remove all the options of a select box, then add one option and select it?

My select box is the following <Select id="mySelect" size="9" </Select> thanks EDIT: This answer was helpful with chaining...however (in IE) .val('whatever') did not select the option that was added. (I did use the same 'value' in both .append and .val) $('#mySelect').find('option').remove().end().append('<option value="whatever">te...

Getting the base element from a jQuery object

I'm struggling to find the right terminology here, but if you have jQuery object... $('#MyObject') ...is it possible to extract the base element? Meaning, the equivalent of this: document.getElementById('MyObject') ...

JQuery & Objects, trying to make a lightweight widget

Trying to make a make generic select "control" that I can dynamically add elements to, but I am having trouble getting functions to work right. This is what I started with. $select = $("<select></select>"); $select.addOption = function(value,text){ $(this).append($("<option></option>").val(value).text(text)); }; This worked fine al...

Getting the ID of the element that fired an event using JQuery

Is there any way to get the ID of the element that fires an event? I'm thinking something like: <html> <head> <script type="text/javascript" src="starterkit/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("a").click( function(){ var test = caller.id; ...

How to read bound hover callback functions in jquery

I used jquery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behavior for some elements. The new module has no access to the original code for the hover functions. I want to store the old hover functions before I set new ones so I can restore them when finished with the ...

Linking combo box (JQuery preferrably)

Hi, I am wondering if anyone has any experience using a JQuery plugin that converts a html <select> <option> Blah </option> </select> combo box into something (probably a div) where selecting an item acts the same as clicking a link. I guess you could probably use javascript to handle a selection event (my javascript knowledge is a...

How do I get a result from a modal dialog in JQuery

I would like to use an add-in like simplemodal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some ajaxy interaction with the server and return the result for the calling code to do some stuff with. Thanks. ...

Access to restricted URI denied code: 1012

How do you get around this Ajax cross site scripting problem on FireFox 3? ...

How to show a spinner while loading an image via JavaScript

I'm currently working on a web application which has a page which displays a single chart (a .png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the chart in the middle of the page. What I want to do is when a link is clicked on ...

How would you go about for switching a site from Prototype to jQuery

I have written a site in Prototype but want to switch to jQuery. Any ideas on how best make the switch? ...

Using jQuery to beautify someone else's html

I have a third-party app that creates HTML-based reports that I need to display. I have some control over how they look, but in general it's pretty primitive. I can inject some javascript, though. I'd like to try to inject some jQuery goodness into it to tidy it up some. One specific thing I would like to do is to take a table (an ac...