- Code: Select all
function HttpRequest(url){
var pageRequest = false
/*@cc_on
@if (@_jscript_version >= 5)
try {
pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try {
pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e2){
pageRequest = false
}
}
@end
@*/
if (!pageRequest && typeof XMLHttpRequest != 'undefined')
pageRequest = new XMLHttpRequest()
if (pageRequest){
pageRequest.open('GET', url, false)
pageRequest.send(null)
embedpage(pageRequest)
}
}
function embedpage(request){
if (window.location.href.indexOf("http")==-1 || request.status==200)
document.write(request.responseText)
}
The embedpage() function is supposed to write the retrieved page (specified using HttpRequest(page URL)). This script does that, except instead of writing the contents of the retrieved page at the location of the script in my HTML source, it gets rid of the rest of the page and loads the retrieved page in its place.
Does anybody know what in this script is causing the rest of the page to get dumped, how I can get the script to write the contents of the received page to the location of the <script> element in question on the page. or of another (client-side) way I can go about doing this other than using an <iframe>?
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.4) Gecko/20060516 Donzilla/1.1 (WML/1.3)


