Link to home
Start Free TrialLog in
Avatar of Samko1
Samko1

asked on

How to display a web page in a DIV?

I have the solution (thanks to DVation191) to display a web page in a DIV, but the solution works only in chrome and firefox. Could anyone with cross browser expertise let me know how to make it work in all major browsers, particularly IE and netscape also? The code that works in Chrome and FF is given below.
<script>
function loadNewPage(temp) {
                var req = new XMLHttpRequest();
                req.open("GET", temp, false);
                req.send(null);
                var page = req.responseText;
                document.getElementById("divid").innerHTML = page;              
}
</script>
 
 
<body>
<a href="" onclick="loadNewPage('more.htm'); return false;" id="current">link</a>
<div id="divid"></div>
</body>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of quincydude
quincydude
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Samko1
Samko1

ASKER

WOW! Thanks Both of You!