jquery Programming Glossary: this.attr
How to disable HTML links http://stackoverflow.com/questions/10276133/how-to-disable-html-links code to disable links td a .each function this.data href this.attr href .attr href # .attr disabled disabled And this one to re.. And this one to re enable them td a .each function this.attr href this.data href .removeAttr disabled Personally I do not..
How to disable tooltip in the browser with jQuery? http://stackoverflow.com/questions/1027762/how-to-disable-tooltip-in-the-browser-with-jquery ' title ' .each function this this .data this 'title' this.attr 'title' this.removeAttr 'title' Another option is to change.. ' title ' .mouseover function this this this.data 'title' this.attr 'title' Using null here wouldn't work in IE but empty string.. wouldn't work in IE but empty string will work just fine. this.attr 'title' '' .mouseout function this this this.attr 'title' this.data..
jQuery + hide native tooltip + Resolved http://stackoverflow.com/questions/1299772/jquery-hide-native-tooltip-resolved ' title ' .each function var this this this.data 'title' this.attr 'title' this.removeAttr 'title' 'a' .click function var this.. ' title ' .each function var this this this.data 'title' this.attr 'title' this.removeAttr 'title' 'a' .click function var this..
Codeigniter AJAX Example http://stackoverflow.com/questions/13887095/codeigniter-ajax-example e var this this var msg this.find '#name' .val .post this.attr 'action' name msg function data this.replace data return false..
Memory leak involving jQuery Ajax requests http://stackoverflow.com/questions/1455947/memory-leak-involving-jquery-ajax-requests function s if this return var el document.getElementById this.attr id if el return var bin document.getElementById IELeakGarbageBin..
Toggle input disabled attribute using jQuery http://stackoverflow.com/questions/4702000/toggle-input-disabled-attribute-using-jquery function return this.each function var this this if this.attr 'disabled' this.removeAttr 'disabled' else this.attr 'disabled'.. if this.attr 'disabled' this.removeAttr 'disabled' else this.attr 'disabled' 'disabled' jQuery Example link . EDIT updated the..
jQuery Looping and Attaching Click Events http://stackoverflow.com/questions/6157645/jquery-looping-and-attaching-click-events img' .click function var this this this.next 'div.' this.attr 'class' .show That should come really close for you. You'll..
Jquery autocomplete and PHP: populating input field with data from mySQL database based on selected option in autocomplete field http://stackoverflow.com/questions/7410091/jquery-autocomplete-and-php-populating-input-field-with-data-from-mysql-databas event ui if ui.item this this alert this suburb field this.attr 'suburb' this.attr 'suburb' .val ui.item.id this.attr 'pcode'.. this this alert this suburb field this.attr 'suburb' this.attr 'suburb' .val ui.item.id this.attr 'pcode' .val ui.item.pcode.. this.attr 'suburb' this.attr 'suburb' .val ui.item.id this.attr 'pcode' .val ui.item.pcode this.attr 'state' .val ui.item.state..
jQuery selector doesn't update after dynamically adding new elements http://stackoverflow.com/questions/9346346/jquery-selector-doesnt-update-after-dynamically-adding-new-elements function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.parent .append ' input type text.. function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.after ' input type text name attendance.. function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.parent .append ' input type text..
How to disable HTML links http://stackoverflow.com/questions/10276133/how-to-disable-html-links add an event handler but you change the link itself. Use this code to disable links td a .each function this.data href this.attr href .attr href # .attr disabled disabled And this one to re enable them td a .each function this.attr href this.data href.. this.data href this.attr href .attr href # .attr disabled disabled And this one to re enable them td a .each function this.attr href this.data href .removeAttr disabled Personally I do not like this solution very much if you do not have to do more..
How to disable tooltip in the browser with jQuery? http://stackoverflow.com/questions/1027762/how-to-disable-tooltip-in-the-browser-with-jquery store it in the element's jQuery data . document .ready function ' title ' .each function this this .data this 'title' this.attr 'title' this.removeAttr 'title' Another option is to change the name of the title attribute to aTitle or something else.. and then put it back on mouseout . document .ready function ' title ' .mouseover function this this this.data 'title' this.attr 'title' Using null here wouldn't work in IE but empty string will work just fine. this.attr 'title' '' .mouseout function..
jQuery + hide native tooltip + Resolved http://stackoverflow.com/questions/1299772/jquery-hide-native-tooltip-resolved out how to add it back for a onclick event WORKING CODE BELOW ' title ' .each function var this this this.data 'title' this.attr 'title' this.removeAttr 'title' 'a' .click function var this this var title this.data 'title' ... do your other stuff..... title attribute in the element's data and use it from there. ' title ' .each function var this this this.data 'title' this.attr 'title' this.removeAttr 'title' 'a' .click function var this this var title this.data 'title' ... do your other stuff.....
Codeigniter AJAX Example http://stackoverflow.com/questions/13887095/codeigniter-ajax-example document .ready function var jQuery '#testajax' .submit function e var this this var msg this.find '#name' .val .post this.attr 'action' name msg function data this.replace data return false better way if you return url of view in json response .post..
Memory leak involving jQuery Ajax requests http://stackoverflow.com/questions/1455947/memory-leak-involving-jquery-ajax-requests head body script type text javascript .fn.removefromdom function s if this return var el document.getElementById this.attr id if el return var bin document.getElementById IELeakGarbageBin before deleting el recursively delete all of its children...
Toggle input disabled attribute using jQuery http://stackoverflow.com/questions/4702000/toggle-input-disabled-attribute-using-jquery is a small plugin that I've just made function .fn.toggleDisabled function return this.each function var this this if this.attr 'disabled' this.removeAttr 'disabled' else this.attr 'disabled' 'disabled' jQuery Example link . EDIT updated the example.. function return this.each function var this this if this.attr 'disabled' this.removeAttr 'disabled' else this.attr 'disabled' 'disabled' jQuery Example link . EDIT updated the example link code to maintaining chainability EDIT 2 Based..
jQuery Looping and Attaching Click Events http://stackoverflow.com/questions/6157645/jquery-looping-and-attaching-click-events div With the following adjustments to the JavaScript '#container img' .click function var this this this.next 'div.' this.attr 'class' .show That should come really close for you. You'll notice that the image and the div share a class that's numbered..
Jquery autocomplete and PHP: populating input field with data from mySQL database based on selected option in autocomplete field http://stackoverflow.com/questions/7410091/jquery-autocomplete-and-php-populating-input-field-with-data-from-mysql-databas HandleAjaxError custom method minLength 3 select function event ui if ui.item this this alert this suburb field this.attr 'suburb' this.attr 'suburb' .val ui.item.id this.attr 'pcode' .val ui.item.pcode this.attr 'state' .val ui.item.state.. custom method minLength 3 select function event ui if ui.item this this alert this suburb field this.attr 'suburb' this.attr 'suburb' .val ui.item.id this.attr 'pcode' .val ui.item.pcode this.attr 'state' .val ui.item.state event.preventDefault..
jQuery selector doesn't update after dynamically adding new elements http://stackoverflow.com/questions/9346346/jquery-selector-doesnt-update-after-dynamically-adding-new-elements Here's my full code 'section#attendance input last' .keydown function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.parent .append ' input type text name attendance ' num ' value Name and Position class medium.. medium ' New Code section#attendance .on keydown input last function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.after ' input type text name attendance ' num ' value Name and Position class medium ' EDIT.. Using .on you can use this #attendance .on keydown input last function e if e.which 9 var this this var num parseInt this.attr 'name' .match d d 0 1 this.parent .append ' input type text name attendance ' num ' value Name and Position class medium..
|