Close Ajax page

Posted on 2014-04-17
Last Modified: 2014-04-25
What is the best way to close an open Ajax page.
Question by:smares323
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40008252
What is an AJAX page?  AJAX is used to connect to the server on a page that is already open.

Author Comment

ID: 40008349
Ok close the Page generated by Ajax
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40008363
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.
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.


Author Comment

ID: 40008662
Ok if I opened a Page with Ajax a div id container after it opens what is the best way to close it

Author Comment

ID: 40008867
How do I close the div after I open it with ajax

Author Comment

ID: 40009676
Hello Dave Baldwin
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 40009696
In the example at , 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'.
LVL 34

Accepted Solution

Slick812 earned 250 total points
ID: 40018374
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.

Author Closing Comment

ID: 40023841
Great advice.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
replacing inline javascript with jquery 4 63
HTML editor custom button 3 84
Scroll 5 news at a time using vticker 2 39
Javascript image manipulationcrop-image 7 41
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question