close page with javascript

C

cmt

I have a javascript(AJAX) that opens an html page in a div. However,
I can't figure out how to then close that html page.

Is there a way to do this?
 
S

SAM

cmt a écrit :
I have a javascript(AJAX) that opens an html page in a div. However,
I can't figure out how to then close that html page.

Is there a way to do this?


document.getElementById('myDiv').style.display = 'none';

or :

document.getElementById('myDiv').innerHTML = '';

depends what you want exactly.
 
C

cmt

Thanks for the code. The javascript that I am using, opens an
external HTML page into a DIV tag like this:

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 ||
window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

So I can try and use the code you provided to then close that external
HTML page.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,369
Latest member
FTMZ

Latest Threads

Top