While requesting a php page from the server using .load() api, or for that matter the .ajax() api of jquery, should the php page be a complete one with all the tags and markings, and also the should it have the database connection details in it?
I tried linking the php page using .load() but it does not seem to work. My php page that is being requested would have lots of images and stuff in it. How do I have this php page displayed using the load() api?
thanks.
I believe that the best practice is to load the resource you want to update dynamically,i.e. only load a partial page.
When loading full pages, it’s likely that you’re loading a lot of data that you don’t need.
Instead, I’d make a block with the html/images/script that you want to update dynamically, and just load this.
Example
Main page
Gallery resource – gallery.block.php
Script