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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:00:47+00:00 2026-06-09T04:00:47+00:00

I decided to load the content of urls into a content div with jQuery

  • 0

I decided to load the content of urls into a content div with jQuery and ajax, was pretty simple to do using .load();

Works really nicely and is nippy as hell. Now i’m looking at this content and realising it has a multitude of forms which when submitted don’t submit within the content div I made.

The only way I can think of streamlining this process is making a dirty great big JS file to handle each form submission dynamically.

Consider there are many forms in this app i’m trying to think of a nice way of submitting forms without page reload within the content div, but keeping some sort of structure to the files behind it at least.

Any suggestions would be hugely welcomed.

As an idea of what i’m doing at a basic level take a look at the code snippet below.

$(document).ready(function(){

    $('a').bind('click', function(e) {        
    $("#content").html('<img src="images/ajax-loader-small.gif">');   
      var url = $(this).attr('href');
      $('#content').load(url); // load the html response into a DOM element
      e.preventDefault(); // stop the browser from following the link       
    }); 

}); 
  • 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-09T04:00:48+00:00Added an answer on June 9, 2026 at 4:00 am
    $.ajax(), $.post(), $.get(), $.postJSON(), $getJSON()
    

    Are your friendly functions in this scenario I think.
    What your basically gonna do is create a click function for your form’s existing submit buttons..

    $('#mysubmitbutton').live('click', function(e)
    {
        e.preventDefault();
        $.post('url/to/post/data', $('#form').serialize(), function(data)
        {
             alert('post made');
        }, 'json');
    });
    

    now of course it gets much more elaborate if you want it to, such as what if my fields are blank, what if the php errors, what if all is good and I want to send it to a new page now or clear the fields, etc.. all of which is possible with these functions, but to cover everything would take a long time, this concept is just to give you a push out the gate, and we are always happy to help you further here when you run into any issues with the function of choice from the above list/example.

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

Sidebar

Related Questions

What is the best way to load content into my infowindow using ajax? Right
I am using jScrollPane for a simple website because I decided to go with
I'm learning F#, and decided to try making simple XNA games for windows using
Before i tried loading the content via the .load() jquery function, i had an
Ok, so I've finally decided on how to load my data I'm going to
Despite being pretty against implementing plugins onto my sites, I have decided to use
Just started tinkering with Dart and I decided to write a simple Http Server
I have an application that requires to use QWebView::setContent() to load some HTML content
Why was it decided that using XMLHTTPRequest for doing XML calls should not do
I have a simple table with a link and an image in a div

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.