mrspoonzy at gmail Cube by Noah Ellman A powerful javascript toolkit, in research © by Noah Ellman

JQuery Versus Jwee

Update: JQuery and Jwee can be used together. In JQuery you must use the jquery.noconflict option so the $ functions don't overlap. Look it up. And as long as you use jquery() instead of $() then everything should work together. Also you can use wee() instead of $() in jwee as well.

Key differences

JQuery is a wrapper, an object that wraps around native Javscript, and provides its own set of methods for everything, which must be used. You can be an expert in jQuery, and know little to nothing about the workings of native javascript.

Accessing elements

Let's say I have a element, and <img>, with the id of logo;


wee("logo").height;  // Works

jQuery("#logo").height  // Returns nothing - syntax ERROR

wee("logo").src="logo2.jpg";  // Works

jQuery("#logo").src="logo2.jpg";  // Does NOTHING - FAILURE

wee("#logo").attr('src', "logo2.jpg");  // Works in JWEE ALSO!

jQuery("#logo").attr('src', "logo2.jpg");  // Works

wee("logo").src="logo2.jpg";  // Works
wee("logo").attr('src'); 		// Returns logo2.jpg

jQuery("#logo").src="logo2.jpg"      // No effect
jQuery("#logo").src		           // undefined
jQuery("#logo")[0].src="logo2.jpg" // Works
jQuery("#logo").attr('src'); 		// Returns logo2.jpg

Understanding “height()” compared to “height”. Remember, in jwee the elements you work with are the actual DOM elements themselves. So you have at your disposal all the native javascript properties and methods for elements, and as the same time you have all the special methods that jwee adds.

Still writing!

Discussion on /learn/jquery-versus-jwee

phil 11/05/14 :  

How the performance compare to jQuery?

Admin 11/05/14 :  

Yes jwee has changed names several times. Thanks for the fixes!