Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: open
var oRequest = new XMLHttpRequest();
var sURL = "http://"+self.location.hostname+"/media/2.php";
document.getElementById("new").innerHTML = oRequest.responseText;
window.onload = reload;
File2 2.php - the one included
var rand_no = Math.random();
This test version of the code should retrieve a obviously inside the <div id="new"></div> a random number followed by the text "file2", but only retrieves the text file2.
In other words all that is dynamically generated in the inclusion file is being stripped off.
im loading an html file into a div
(and also fading out old content, and in with new content)
and it works fine until the html file i load into the div trys to access dynamic data from an xml file, in which case all i get are the variable names displayed.
var divjs = "var rand_no = Math.random();
divTag.innerHTML ="<script>"+ divjs+"<\/script>";
i used this on another website and it works.
for your problem i suggest pre-loading the stuff you want shown(if it's not to big) and put in another hidden div:
<div id="hidden" style="display:none;> data from xml</div>
<div id="visible"> old content</div>
not sure about the syntax.
That is if you only want to change the content once.
how do you suggest doing it in php?
[edited by: engine at 7:57 am (utc) on June 23, 2009]
[edit reason] No urls, thanks, see WebmasterWorld TOS [/edit]