javascript - Unload html page with jQuery ajax -


this question has answer here:

i have code load on div whole page:

 $('.class').click(function(){      $(this).load("file.php");  }); 

the idea is, whenever click on "x" button in upper right corner want close page. thinking .hide(), guess unnecessary time loaded right under parent site. considering session destroy since loaded page has .php end. red few things .unload() doesn't give effects @ all:

$('.escape-btn').click(function(){     $(this).unload("file.php"); }); 

the unload method deprecated , not seem intending here.

if goal clear out, try $(this).empty()

https://api.jquery.com/empty/


Comments