Jump to content

Unload AJAX


chrischen

Recommended Posts

 

You could do something like this:

 


<script language="javascript">
var content = "yourDIVsIDHere"; // replace this with your div's id; the div that contains your external page, that was loaded by ajax
function resetDIV()
{
document.getElementById(content).innerHTML;
}
</script>

<div id="yourDIVsIDHere">
<!-- external page would have been displayed here -->
</div>

<br><br>

<input type="button" onclick="resetDIV()" value="Clear It!">

Link to comment
https://forums.phpfreaks.com/topic/92239-unload-ajax/#findComment-473204
Share on other sites

or... instead of replacing the old text you could just use a style to hide it. and display the new, then vise versa to go back.

 

so...

 

/* Some ajax stuff above */
if(ajaxRequest.readyState == 4){
     document.getElementById('newPageStuff').style.display = "block";
     document.getElementById('oldPageStuff').style.display = "none";
} 
/* Some ajax stuff below */

Link to comment
https://forums.phpfreaks.com/topic/92239-unload-ajax/#findComment-473403
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.