I just started learning jquery and I am struggling on some concept problem.
If I use load() to update one of the div sections in my website, e.g.:
//link to open another page
$('a#open_page').click(function() {
var myURL = "page.php";
$('#ajaxHandle').load(myURL);
return false;
});
My question is, is everything in page.php going to be loaded literally? If page.php has some headers or php code, are they going to be loaded as well?
This will fetch the URL from the server and replace the contents of the element with id
ajaxHandlewith the result.What comes back from the request depends on your server. If there is PHP code, and if it executes normally, then you will get the response of the executed PHP. It is just like a normal HTTP request (like the one you used to serve the original page).