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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:12:16+00:00 2026-06-05T17:12:16+00:00

Here is my code: <script> function loadPage() { function sendFormHelper(callback) { var url =

  • 0

Here is my code:

<script>

    function loadPage() {

        function sendFormHelper(callback) {
            var url = "/same-as-current-url";
            var serializedForm = $('#form').serialize();
            $.post(url, serializedForm, function(data) {
                callback(data);
            });
        }

        $('#form').off('submit').on('submit', function() {
            sendForm(function(data) {
                var mainResultCount = $(data).find('#main-result-count');
                var mainList = $(data).find('#main-list');
                $('#main-result-count').html($(mainResultCount).html());
                $('#main-list').html($(mainList).html());
                loadPage();
            });
            return false;
        });

    }

    $(function() {
        loadPage();
    });

</script>

<form id="form">
    <!-- some stuff -->
</form>

<div id="main-result-count">
    <!-- some stuff that can change -->
</div>

<div id="main-list">
    <!-- some stuff that can change -->
</div>

As you can see, instead of reloading the page when the form is submitted, I catch the event and send it using AJAX. The returned data is a whole HTML page, almost indentical as the one the user see. From that page, I update the current layout with the data that potentially change.

I have several other JS scripts on the page, that are quite long to run, and a lot of layout data like images, CSS, menus, etc. Do all of that data and the DOM are also loaded when getting the response of the AJAX request even if that content isn’t displayed, or is that kind of stuff only loaded when parsed by a browser, and stay then a kind of big string?

I can’t find what kind of test I should implement to find the answer on my own :(

  • 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-05T17:12:17+00:00Added an answer on June 5, 2026 at 5:12 pm

    No the other stuff will not get loaded when you do this. The ajax request will only fetch the markup itself. It will not also pull in external scripts, run scripts, etc. Only a browser loading an HTML session would do that.

    You can investigate with a tool like Firebug to verify I am correct here.

    Go ahead and watch the Network I/O from Firebug while you make your request. You will notice that no javascript/css resources are getting loaded… just the markup from the servlet.

    Hope this helps.

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

Sidebar

Related Questions

here is my code.. <script type=text/javascript> function clicker(){ var thediv=document.getElementById('downloadoverlay'); if(thediv.style.display == none){ thediv.style.display
Here is the code <html> <head> <script language=JavaScript> <!-- function myFunc() { var doc
i am using jquery addClass and removeClass function here is code <script> $(document).ready(function() {
Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
I have the basic jQueryUI progress bar code here; <script> $(function() { $(#progressbar).progressbar({ value:
Here's my code: <script type=text/javascript> (function() { window.PinIt = window.PinIt || { loaded:false };
Here's my code <script type=text/javascript> function getNextScroll(i){ <asp:Literal ID=infiniteScrollTableJS runat=server></asp:Literal> } </script> I am
Here's my code: <script src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js></script> <script> $(document).ready(function(){ $( #draggable ).draggable(); }); </script> <div id=draggable
i have this (simplified) <script> dataToSend = 'dummy data here'; function sendIt() { //code
I use BBC carousel http://www.bbc.co.uk/glow/docs/1.7/furtherinfo/widgets/carousel/ . Here is my script code <script src=/themes/javascript/glow/1.7.7/core/core.js type=text/javascript></script>

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.