2013年4月16日 星期二

Loading HTML Content from the Server

$(selector).load(url, data, callback) allows HTML content to be loaded from a server and added into a DOM object

image

We can even filter the content that returned from server

image

Data can be passed to the server by using load(url, data)

image

A callback function used

image

 

Demo Example:

1. .load()

image

image

Output result:

image

 

2. Filter content

image

image

Output result:

image

 

3. Callback function

image

image

 

4. With Data passed to server

image

image

Output result:

image

沒有留言:

張貼留言