Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

Close Ajax page

What is the best way to close an open Ajax page.
0
smares323
Asked:
smares323
  • 5
  • 3
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
What is an AJAX page?  AJAX is used to connect to the server on a page that is already open.
0
 
smares323Author Commented:
Ok close the Page generated by Ajax
0
 
Dave BaldwinFixer of ProblemsCommented:
AJAX doesn't normally generate pages, it is used to modify the page that it is being used in.  I don't know what you're doing.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
smares323Author Commented:
Ok if I opened a Page with Ajax a div id container after it opens what is the best way to close it
0
 
smares323Author Commented:
How do I close the div after I open it with ajax
ajaxcode.txt
0
 
smares323Author Commented:
Hello Dave Baldwin
0
 
Dave BaldwinFixer of ProblemsCommented:
In the example at http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm , they loading a div with external content.  Although they are saying 'page', it's not a complete page.  Basically, to get rid of the content, you load some other content even if it's just a blank space.  You could also just set the display to 'none'.
0
 
Slick812Commented:
greetings smares323, I looked at the code in the ajaxcode.txt , and that looks like some older code to a very simple AJAX Exchange, the question you have "close an open Ajax page", has noting to do with AJAX, and is just about using javascript.
this javascript -
document.getElementById("contentarea").innerHTML = "";

would get rid of the content that was loaded into that DIV by AJAX, however, there is no where on that page to place this javascript and have any correct functioning, or application to use that code.

here is a button that may work if you place it on the page-
<button onclick='document.getElementById("contentarea").innerHTML = "";'>Close Page</button>

not sure about what you are trying to do, but I see no reason to erase that DIV of content from AJAX, since there does not seem any way to do anything else in that code for that DIV to be used any other way.
0
 
smares323Author Commented:
Great advice.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now