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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:34:02+00:00 2026-06-11T14:34:02+00:00

I tried to load content inside content those are loaded previously with AJAX. I

  • 0

I tried to load content inside content those are loaded previously with AJAX. I put the code

with load():

jQuery("#contentpage").on("submit", "#loginform", my = function() {
    $("#contentpage").load("/logincheck.jsp");
    alert("this is required ");
});

with $.ajax():

jQuery("#contentpage").on("submit", "#loginform", function() {

    $.ajax({
        url: '/logincheck.jsp',
        success: function(data) {
            $('#contentpage').html(data);
        }
    });

    alert("this is required ");
});

#loginform is a HTML form loaded with previous AJAX request, I successfully access in with .on() function.

But the problem is when I submit #loginform without putting alert('this is required') box then its refreshing the whole page.
Also content inside #contentpage are also not changing.

But if I do the same with putting alert("this is required"), its working fine, contents are getting loaded in #contentpage without refreshing whole page.

Is this a timing issue? Ajax request takes time and it’s asynchronous? Please correct me if I am wrong.

  • 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-11T14:34:03+00:00Added an answer on June 11, 2026 at 2:34 pm

    have you tried this?

            jQuery("#contentpage").on("submit","#loginform",my=function(event){ 
                 event.preventDefault();
                 $("#contentpage").load("/logincheck.jsp");
                 alert("this is required ");
            });
    

    This should at least stop the page from refreshing and may sort out the other problems as well. Good luck!

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

Sidebar

Related Questions

I have a div which get's its content loaded through ajax .load(ajaxcontent.php). Inside this
I have a website that uses ajax jquery and colorbox. Inside the div #content
I tried one of the examples here to load the content in the div,
I've tried to load Disqus with ajax in my page, i'll explain. I have
I tried the following: $.load(Views/chatBox.html).appendTo('body') Console Output: TypeError: $.load is not a function EDIT
I have a standard jquery ui accordion and I load content into it using
Hai i tried to load a swf(text.swf) inside swf(video.swf).In my (text.swf)i passed some text.while
I have a jQuery DOMWindow that's loaded with AJAX on one of my web
I would like to load some content using AJAX and Shadowbox Basically I would
I'm trying to open a jQuery dialog using AJAX. The content of the dialog

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.