views:

11

answers:

0

Main.html

Main Page

GetPage.js

function ahah(url,target) { document.getElementById(target).innerHTML = 'loading data...'; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = function() {ahahDone(target);}; req.open("GET", url, true); req.send(null); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = function() {ahahDone(target);}; req.open("GET", url, true); req.send(); } } }

function ahahDone(target) { // only if req is "loaded" if (req.readyState == 4) { // only if "OK" if (req.status == 200 || req.status == 304) { results = req.responseText; document.getElementById(target).innerHTML = results; } else { document.getElementById(target).innerHTML="ahah error:\n" + req.statusText; } } }

function load(name,div) {

ahah(name,div); return false;

}

History.html

History Page

History Page

document.write("History Page");

The Script works great. i am able to get the History.HTML Loaded perfectly under Div=GetDiv but i am unable to execute or run the Script under history.html page when its loaded under div.

Script on history.html page works well if opened in a new browser i.e. http://localhost/history.html

My main idea is to execute the script under history page and display it under GetDiv

Please Help !!!