Sorry maybe I didn't explain what I meant too well:
Rather than:
1. me making a request for the page,
2. the server sending me the page,
3. then my browser (via AJAX) sending two requests for the side_bar and main_body,
4. and finally writing them to the dom via JS (well actually via innerHTML);
why not just build all that on the server at my first request and save the overhead (I am completely missing out on something here?).
If this is just for experiment then keep it up!
Rgds
Richard.
You can not request another page using ajax or javascript if the page requested is on a different domain. It's a security built into javascript that doesn't allow it.
If you try you will get a "Permission Denied" error, the reason we use fopen or curl function.
I tried it but it didn't work.
The page requested has to be executed on the domain that owns the page, then send it over to the requesting party.