jQuery lazy loading

Loading the library

Targeting it…and callbacks

Specifying the images

Since your jQuery targets class lazy, we must use lazy for classes on img and div tags.
You use data-src to specify the location of the images.

Note that for img tags, when the images load, it will change to data-src will change to src.
However, if you were to use div, data-src will change to background-image: url(….) .

add header in ajax request using jQuery

ref – http://stackoverflow.com/questions/10093053/add-header-in-ajax-request-with-jquery

Here is an example how to set a Request Header in a JQuery Ajax Call:

in another example,

async to true/false

You set async to false, when you need that ajax request to be completed before the browser passes to other codes:

Does it have something to do with preventing other events on the page from firing?

Yes.

Setting async to false means that the statement you are calling has to complete before the next statement in your function can be called. If you set async: true then that statement will begin it’s execution and the next statement will be called regardless of whether the async statement has completed yet.

retrieve data through ajax

In order to retrieve data via ajax, we give it some parameter data like requestId, andn telNum, then it will return a data through a data parameter. In our case, it is data.

Send html data via jQuery and AJAX to JSON url

You got whole bunch of data in textboxes and combo boxes. You retrieve those data by their id using jQuery like so:

Once you get these data…you pass it into ajax’s data parameter and you’re basically done:

single click on datagrid

This is how you detect single click on datagrids using easyui:

or

SET content

Setting DOM data with .text, .html, and .val

callback

Changing attributes

Callback for getting attribute value

GETting – Manipulate DOM

Simple functions

UI value extraction

Getting attributes