jquery

Why does $('someObject').attr("id")[0] not work in IE?

Hi, The following jquery code works in firefox, but is returning undefined in IE: $('someObject').attr("id")[0] Why is that? ...

How to select an element that has focus on it with jQuery

How can you select an element that has current focus? There is no :focus filter in jQuery, that is why we can use something like this: $('input:focus').someFunction(); ...

jQuery: Unbind event handlers to bind them again later

Hi all, Does anybody know how to unbind set of event handlers, but memorize them in order to bind them again later? Any suggestions? ...

Paging Through Records Using jQuery

I have a JSON result that contains numerous records. I'd like to show the first one, but have a next button to view the second, and so on. I don't want the page to refresh which is why I'm hoping a combination of JavaScript, jQuery, and even a third party AJAX library can help. Any suggestions? ...

Set variable on drop using jquery draggable/droppable

I am working on a proof of concept that makes use of the jquery ui draggable/droppable. I am looking for a way to set a variable equal to the index of a div that is dropped into the droppable area. (Say I have divs named "div0", "div1", "div2", etc...) So imagine the code would look something like this: <div id="div0" class="draggable...

How can I make a wufoo like web app

I want to mimic wufoo form builder web app, I used jquery to drag and drop elements on a workspace, but I need a way to let the user save his finished work , and download his work as html page, can any one help!!! ...

how to get distinct values from json in jquery

I've got a jquery json request and in that json data I want to be able to sort by unique values. so I have {"people":[{"pbid":"626","birthDate":"1976-02-06","name":'name'},{"pbid":"648","birthDate":"1987-05-22","name":'name'},..... So, far, i have this function(data){ $.each(data.people, function(i, person){ ...

javascript/jquery leaking and crashing browser

Let me just preface by saying it's actually my crappy code that's leaking and crashing my browser, I just thought I better make the languages being used as clear as I could from the outset. I have a test page here and the javascript can be found here. My problem is that when I try and drag and drop either one of the red pieces more than...

Best Practice for Storing JSON Data That Will Be Passed to jQuery Plugin

I'm looking for the "best practice" as to where the JSON should be stored if it's just a string array. Should it be stored in a variable in a script block in the HTML page? Should it be stored in a JavaScript file outside of the HTML for separation? Or should it be stored in the plugin itself? If it should be an external js file, what's...

Possible to make IE7 reload the DOM? Trying to update RSS href url in link tags

I can use this jQuery code to dynamically change the RSS link in the DOM in Firefox & Chrome. http://path.com/feed is normally replaced by a variable, but not for this example. $('#rssfeed').remove(); $('head').append('<link id="rssfeed" rel="alternate" type="application/rss+xml" href="http://path.com/feed"/&gt;'); The live bookmark f...

Reordering of table rows with arrow images for up and down?

I want to add small images-arrows for moving up and down on table row in Javascript (maybe jQuery) and save the reordered table (only the order) in cookie for further use. An example would be - Joomla, inside the admin area in the Articles area (but that is done with php). Thanks. ...

jQuery: $().click(fn) vs. $().bind('click',fn);

When using jQuery to hookup an event handler, is there any difference between using the click method $().click(fn) versus using the bind method $().bind('click',fn); Other than bind's optional data parameter. ...

jQuery Validator, programmatically show errors

I can do something like this: validator.showErrors({ "nameOfField" : "ErrorMessage" }); And that works fine, however if I try and do something like this: var propertyName = "nameOfField"; var errorMessage = "ErrorMessage"; validator.showErrors({ propertyName : errorMessage }); It throws an 'element is undefined' error. ...

CSS Table Cell Background Image Text Overlap

I'm using the Tablesorter Jquery plugin to sort a table, but the images background images specified in the stylesheet fall behind the text on columns in which the actual content of the column isn't long enough to push the column width beyond the length of the header text. For an example, go here: http://tablesorter.com/docs/ and then sh...

How can I set up JQuery autocomplete like Stackoverflow's tags input field?

I'm using PHP and I've never really done anything with Javascript or JQuery or AJAX. I'm just wondering if there are any available solutions to accomplish the same effect of auto-completion that SO uses for entering tags. There are plugins which can handle one word but I haven't seen any that handles multiple words. Also, I hear JQuery...

What is the jQuery equivalent of Prototype's Element.extend

I know that jQuery.extend can be used to add by own custom methods to an object such as a DOM element but Prototype's Element.extend adds all the DOM element helper methods to the object. It is that functionality that I am after. For instance this.panel = document.createElement('div'); I want this.panel to be a reference to that new ...

Controlling the value of 'this' in a jQuery event

I have created a 'control' using jQuery and used jQuery.extend to assist in making it as OO as possible. During the initialisation of my control I wire up various click events like so jQuery('#available input', this.controlDiv).bind('click', this, this.availableCategoryClick); Notice that I am pasing 'this' as the data a...

jQuery Queueing Animations

I have three images and using the following code I have then fade in an out on mouse rollover. (they are all in a div of their own with the class 'thumbs') $(".thumbs img").fadeTo("slow", 0.3); $(".thumbs img").hover(function(){ $(this).fadeTo("normal", 1.0); },function(){ $(this).fadeTo("slow", 0.3); }); The problem is that ...

jQuery If DIV Doesn't Have Class "x"

In jQuery I need to do an if statement to see if $this doesn't contain the class '.selected'. $(".thumbs").hover(function(){ $(this).stop().fadeTo("normal", 1.0); },function(){ $(this).stop().fadeTo("slow", 0.3); }); Basically when this function is run (on hover) I don't want to perform the fades if the class '.selected' has been ap...

jQuery $.get works but not $.ajax

Hello All I am new to jQuery and I am using ajax request to get an xml as response, $.get("testurl",pars,function(data){ xml = data; $(xml).find("element").each(function(i,item){ if(($(this).attr("id"))!= undefined){ tab_str += "<tr><td>'id'</td><td>"+$(this).attr("id")+"</td></tr>"; } }); ...