This article was written to emphasize some of advantages and disadvantages of using jQuery.
What is jQuery?
jQuery is a small JavaScript library that includes support for manipulating the DOM, supports AJAX and it provides some basic graphical effects. The functionality can be enhanced with plugins. Compared with other toolkits, jQuery aims to change the way that web developers think about creating rich functionality in their pages. Minimal knowledges of Cascading Style Sheets (CSS), Extensible Hypertext Markup Language (XHTML), XML Path Language (XPath) and JavaScript are sufficient for manipulating page elements with jQuery.(For more details about jQuery visit http://jquery.com/)
jQuery in action
XST or XmlSmartTree is a custom ASP control, similar to DataGrid, which has as primary objective to display his data source as a tree. Beside that the control allow multiple skins on rows, contains search functionality and expend or collapse functionality for rows that have children. All Html code it’s generated on server-side, thus the control is represented in Html as an table with tr elements for each data source row. Every generated tr element is bound to JavaScript events like onmouseover, onmouseout, onclick etc. .
I used the XST control with a large data source (about 800 rows) and I noticed that the bound events didn’t work very quickly, in addition the web page size has reached almost 350 kilobytes. As a solution for this issues I started to replace the JavaScript events code with jQuery code.
Sample of jQuery code for click, mouseover and mouseout events:
jQuery('select all tr elements').hover(OverAndOut,OverAndOut).bind('click',ClickFunction); function OverAndOut(event){ jQuery(this).toggleclass('overclassname');} function ClickFunction(event){ jQuery(this).addclass('clickclassname')} |
Conclusions:
After I replaced the JavaScript code, all events bound to the html code were removed and the page size was reduced to 240 kilobytes, but about execution speed I can not say that there are visible improvements.
Finally, there’s another very important peculiarity of what does Cialis that brings it so high above its alternatives. It is the only med that is available in two versions – one intended for use on as-needed basis and one intended for daily use. As you might know, Viagra and Levitra only come in the latter of these two forms and should be consumed shortly before expected sexual activity to ensure best effect. Daily Cialis, in its turn, contains low doses of Tadalafil, which allows to build its concentration up in your system gradually over time and maintain it on acceptable levels, which, consequently, makes it possible for you to enjoy sex at any moment without having to time it.