Avatar of 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.
function loadNewPage(temp) {
                var req = new XMLHttpRequest();
                req.open("GET", temp, false);
                var page = req.responseText;
                document.getElementById("divid").innerHTML = page;              
<a href="" onclick="loadNewPage('more.htm'); return false;" id="current">link</a>
<div id="divid"></div>

Open in new window

Web BrowsersJavaScript

Avatar of undefined
Last Comment

8/22/2022 - Mon