Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7025073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:55:34+00:00 2026-05-27T23:55:34+00:00

After an Ajax call I reload a web page. I have two options.. I

  • 0

After an Ajax call I reload a web page. I have two options..

  1. I can send the page as responseText and have it write to the screen using document.write().

  2. I can send a control to Javascript telling it to reload the web page using window.location.href.

Option 1 is good because it takes only one round trip instead of two. However the onload Event was not triggered as it would with a normal reload.

Option 2 is good because it triggers the onload Event.

Is there any way to to get the best of both worlds…i.e. I would like to send the page using responseText but also have it loaded like a new page, once it is recevied.

I simply does not make sense to make 1.5 trips instead of .5 trips when you are on the server (control is on the server) and need to reload the page. Is this a weakness of Ajax or do I just not know hot to do it?

Related:

Caching Issues

*

Similar Post

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:55:34+00:00Added an answer on May 27, 2026 at 11:55 pm

    Ok from what I see you want to load a new page when an user registers. The best way to do this is without ajax. As the page gets loaded and the onLoad event gets fired.

    But you also want to check if the email the user used is already in use. The way I like to do this is to make a variable and set it to false. The use the onchange event of the email input field to run an ajax validation. And if the email is available and valid I set the variable to true. And I add a function to the button’s onsubmit event and return the variable. This way the user gets redirected only if the email is available.

    Or:

    You can move all of your code from the onLoad event into a function. And simply call it when you get set the page using response text. And rather than using ‘document.write()’ I’d recommend using document.body.innerHTML and document.head.innerHTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How one can reload the custom JavaScript file after an Ajax call is completed?
I have a html page that after ajax call show a lot of data
I'm new with jqTree and I'd like to reload the tree after ajax call.
Possible Duplicate: jQuery: Return data after ajax call success I have the following function
how can i disable live('click', function...) method and then after ajax call (depending on
The commandlink link2 does not have work after an ajax call is made to
I have 4 scripts which I want to call one after another through ajax.
I call a controller action using jquery ajax (see the below code), After the
After doing an AJAX call, am redirecting- using the following code. But, after AJAX
We have a addonEvent function to perform some scripts after ajax call. But if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.