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

Web BrowsersJavaScript

Avatar of undefined
Last Comment
Samko1

8/22/2022 - Mon