Wednesday, January 20, 2010

I'm loving JQuery

I would have to admit that when I was given my first Javascript and JQuery task, I had absolutely NO interest or passion in that language due to its unstructured-ness and lack of useful code-writing tools. Note: I came from a Java and .NET background and declaring variables without defining the type (int, string, etc) feels really really strange.

I am currently working on my third JS & JQuery project (I mostly copied codes from the net for my first 2 projects) and I starting to see the LIGHT! The unstructured-ness of things has been clouded by how easy it is to get what I want! Minimal coding/scripting was the highlight of the day!

I am proud to say that I am a JQuery convert and here are some tips to help everyone kickstart their coding-life transformation! :)

Important important reference: http://docs.jquery.com/
Here you'll get all the JQuery APIs properly documented.

To refer to any element in the HTML page (or select them, in JQuery language), use $("#id") where id is the id name of the element. You can also use $(element) which selects all the generic elements in the page. Example: $(a) selects all the <a> in the page! More selectors here. Once you "selected" the element, you can manipulate it easily (attributes, click/hover functions, etc).

Next we have the document ready function.
$(document).ready(function() {
// function code here
});
This function is called when the page is loaded.

and the connection with SharePoint Services. Many thanks to the kind people at Sympraxis Consulting LLC that made SP Programming much simpler and light-weighted!


No comments:

Post a Comment