Working with jQuery
I have now been working with jQuery for a while and found very good usage in using there specific features:
Together with MS Ajax:
Using jQuery together with MS ajax results in some $ naming conflicts, since both MS Ajax and jQuery used the $ use their default namaspace.
It can be resolved by either rename the jQuery namespace, by using . jQuery.noconflict() method or simply by using the jQuery namespace directly for all jQuery usage.
Context:
I will recommend to always specify context when doing jQuery’s.
When using jQuery from inside a MS Ajax usercontrol, it could be done e.g. specifying this.get_element() which is the controls main html element.
So getting an element within the current Ajax control could look like:
var jqElem = jQuery(”#elementid”, this.get_element());
To get, set and use attributes in jQuery could be done like this:
jQuery(”#elementid [myattr='myvalue']“, this.get_element()).attr(”title”, “myTooltip”);
removing it, doing this:
jQuery(”#elementid [myattr='myvalue']“, this.get_element()).attr(”title”);
….. more to come …..
Twitter