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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:47:50+00:00 2026-05-16T03:47:50+00:00

I still am confused regarding Ajax technology. And I still cannot answer this question

  • 0

I still am confused regarding Ajax technology. And I still cannot answer this question of mine as I am still trying to grasp the technology.

Its regarding posting data with the server. In normal non-ajax web app, I usually do PRG (Post-Redirect-Get) pattern when I am doing a POST command. I have learned that this will prevent double submit problem or when the user tries to refresh the page or perform some Back-Forward transaction at the browser.

In Ajax, you do not perform a redirect because this will defeat the purpose of ajax as this is what the tutorials and books that I am folowing is saying

In Jquery, when I perform

$(document).ready(function(){
    $("#myForm").submit(function(){
        $.post("test.htm", function(data){
            alert("Successfully save data");
        }, "json");
        //prevent page refresh
        return false;
    });
});

and the user performs, refresh(F5) or user performs a Back and Forward browser transaction.
Am I not risk of having double submit problem? Will the browser reload my click event again.

Sorry if this might sound too dumb to others but I just want to clarify my thoughts for a newbie like me.

  • 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-16T03:47:50+00:00Added an answer on May 16, 2026 at 3:47 am

    It depends on where you put that code, if that code is on a click event handler for a button or something, then reloading the page will not re-trigger the click. If you just drop that code exactly as is on your page (or in a $(document).ready function) then, yes, reloading the page will re-submit that request.

    Since ajax is triggered by a user action, double submitting isn’t a problem unless the user performs that action twice. Since you’re handling everything in javascript anyway, it is easy to remove that action – or the button the user is clicking – after they have done that action once.

    Does that make sense? Hope that helps.

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

Sidebar

Related Questions

I have read many answers regarding this still i am getting confused if i
This question may sprout from the fact that I'm still confused about context and
I can't believe I'm still confused about this but, any way, lets finally nail
I've read a few posts on this but I'm still confused. I have this
I read this thread jQuery vs jQuery Mobile vs jQuery UI? but still confused.
I am coming back from after reading this c-faq question I am totaly confused
Following up on my earlier question regarding GAE Datastore entity hierarchies , I'm still
I have a question regarding this article. Between this code function odds(n, p) {
I have read many articles regarding layout, but I am still quitely confused. My
I'm still slightly confused after reading this topic. Is the following C++ expression *d++

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.