Forum Moderators: open
The script looks like this:
// Get the HTTP Object
function getHTTPObject(){
if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest) return new XMLHttpRequest();
else {
alert("Your browser does not support AJAX.");
return null;
}
}
// Change the value of the outputText field
function setOutput(){
if(httpObject.readyState == 4){
document.getElementById('myBody').innerHTML = httpObject.responseText;
}
}
// Implement business logic
function loadSite(){
httpObject = getHTTPObject();
if (httpObject != null) {
httpObject.open("GET", "templates/derk/content.php", true);
httpObject.send(null);
httpObject.onreadystatechange = setOutput;
}
}
var httpObject = null;
In content.php the body has the following code which loads the content of my page:
<body onLoad="loadSite();" id="myBody">
It works only for 50% because the parsed code in Firefox ads /cms/ to the internal links/file structure. I think because it's a Joomla site which is installed in /cms/.
For example:
This is how for instance a js should look:
<script type="text/javascript" src="templates/derk/Scripts/activestate.js"></script>
But now it looks:
<script type="text/javascript" src="/cms/templates/derk/Scripts/activestate.js"></script>
What did I do wrong?
[edited by: whoisgregg at 12:50 pm (utc) on May 13, 2009]
[edit reason] Whoops, no URLs please. See TOS [webmasterworld.com] [/edit]
If not, then it could simply be a relative path issue. The browser may be the one adding the /cms/ to the beginning because the path specified is relative instead of absolute. Try changing this line:
httpObject.open("GET", "[red]/[/red]templates/derk/content.php", true);