jQuery Ajax loading div question -


I have a question about jQuery Ajax question. My question is: If I load a portion of an HTML using jQuery Ajax, like:

  $ ('# result'). Load ('ajax / test.html #container');   

Does the user have to download whole test.html to view in #container div? In other words, will the whole test.html file be downloaded and then will be parsed to select only # container divas, or will only download # container device? If this happens for the first time, can you think of just downloading # container divas without creating a new HTML file?

Thanks a lot for your input! :) I really appreciate it.

Surely the entire HTML will be downloaded.

If you want to avoid it, then you have to create some type of server side script, for example PHP, which will only send the necessary content.

You can call it in some way

  $ ('# result') load ('ajax / test.php ajax = 1?') .; In PHP checks for the existence of   

and $ _GET ['ajax'] , and if it exists, then only #container div

Comments