Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
If you don't know anything about the server, you shouldn't be using AJAX. That is pretty much the end of the story. AJAX is made for interacting with the server, so if you don't have some programming on the other end, there is no advantage to calling stuff asynchronously, especially since doing so is somewhat slow.
If all you need is one external file that is shared over multiple page, or "included" onto the page, you should be doing that inclusion from the server itself. Since you have PHP available, name your files with a .php extension, and do something like this:
PHP Code:
<!--HTML--> <div> <?php include "path/to/included-file.htm";?> </div> <!--more HTML-->
This will avoid the lag of an AJAX call just to call some content. Plus, the content will still be available even if JavaScript is disabled.
|