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 8524087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:35:30+00:00 2026-06-11T07:35:30+00:00

I found that if I use AJAX calls on a page, the page source

  • 0

I found that if I use AJAX calls on a page, the page source stays intact. This can cause problem, e.g. if user use forward/backward operation in a browser, when it backs to the page browser will have/read original HTML code and not the one with AJAX content. For example, let’s say you construct a page with

<div id="foo">
<script type="text/javascript">
setTimeout('ajaxFunction', ...);
</script>
</div>

once you load the page, it will call ajaxFunction, which eventually will replace content of div tag with id=”foo” (btw, it can be recursive calls as well). But the page source which you can view from the browser will still contains this snippet. Is there is any way to refresh page source without reloading the page?

I know that I can add page reload inside of my AJAX code, but I’d like to avoid it and not disturb end-users.

  • 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-06-11T07:35:32+00:00Added an answer on June 11, 2026 at 7:35 am

    If you are taking about “view source” option available with right click – some browsers, if not all, are doing another request to get an HTML. Developer Tools/Firebug will show you updated HTML, but appears that after next/forward navigation initial HTML (without changes done with JS/AJAX) is shown. I thought that chrome will cache dynamic changes too but just checked this and it shows initial page. Suppose there is no way to change this behavior. The only way here, as for me, is to call ajaxFunction in document.onload if you want to be sure that the latest info is shown to user.

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

Sidebar

Related Questions

I found out that I can use a different theme in an C# WPF
I'm attempting to use code I've found that uses Win32. However, I'm getting this
I found out that methods called by ajax actions in JSF 2.0 can return
I found that when I use HttpWebRequest to establish SSL\TLS connection, it takes near
I found that most tutorials use one big router. For example: https://github.com/thomasdavis/backboneboilerplate/blob/gh-pages/js/router.js Wouldn't it
I found that in the cocos2d Best Practices there is a suggestion to use
I've found that in order to use PRISM's classes in XAML you need to
I haven't found any references to apps that use a custom activity indicator --
I tried to use $.cssRule() plugin and found that it makes it inconvenient to
We want to use Unicode with Delphi 2009 and Interbase, and found that to

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.