Solved

Does AJAX request go thru full Javascript page cycle (onload, onunload, etc)?

Posted on 2008-06-25
3
467 Views
Last Modified: 2010-05-18
I have functions set in my window.onload and window.onunload events for a page. If that same page gets called via an AJAX request, does the window.onload and window.onunload events get fired within that request?
0
Comment
Question by:bemara57
  • 2
3 Comments
 
LVL 30

Expert Comment

by:Steggs
ID: 21873393
Hello,

One of the benefits of ajax is not having to reload the page when the server is ready to answer the request.... so no your window events wont get called through ajax. You could call your functions from inside ajax if you wanted?

Steggs
0
 

Author Comment

by:bemara57
ID: 21875711
I understand the page initiating the AJAX request doesn't go thru the page life cycle because no reloading is done. But the AJAX request destination page, does it go thru the whole page life cycle because it's not an actual browser processing the remote AJAX page, but was wondering if the remote page's events get fired. I have some calculations done in my onload on the remote page, so by calling the page thru an AJAX request, does the onload of the remote page still get fired?
0
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 21878074
Remote page? So the page will be loaded by the user? If so, then yes the cycle will be initiated
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AJAX pass along a variable 3 46
Binding a Grid in Javascript 5 45
javascript - insert into js doc help 2 25
Javascript 2 28
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

821 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