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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:39:11+00:00 2026-05-13T21:39:11+00:00

Has anyone ever tested, or does anyone know, the performance differences of these two

  • 0

Has anyone ever tested, or does anyone know, the performance differences of these two different ways of rendering the same html content (other than the fact that one has imported the jquery library and the other hasn’t, and that there are two requests in the Ajax version versus one)?

Add HTML via Ajax

<html>
<head>
    <script src="javascripts/jquery.js" type="text/javascript"></script>

    <script type="text/javascript">
    jQuery.ajax({
        type: "GET",
        url: "http://www.mysite.com/events",
        success: function(result) {
            $("#container").append(result);
        }
    });
    </script>

    <body>
        <div id="container">
        </div>
    </body>
</html>

Inline HTML

<html>
<head>
    <body>
        <div id="container">
            <!-- events -->
            <ol>
                <li>
                    <p>
                        Event A...
                    </p>
                </li>
            </ol>
        </div>
    </body>
</html>

What are the statistics on this, when would you and wouldn’t you use something like this? How much slower is the Ajax version (say, if I were to render something as complex as the Amazon homepage, assuming I didn’t have to worry about paths, since this would be my own app)? This question is independent of best practices for readability and all that, just wondering about performance.

  • 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-13T21:39:11+00:00Added an answer on May 13, 2026 at 9:39 pm

    The overall performance in your example isn’t dominated by the rendering performance of $("#container").append(result); vs inline HTML. It’s dominated by the number of HTTP requests.

    In the HTML-only example, only one single HTTP request is made, and the content can begin rendering as soon as the first few chunks are downloaded.

    In the JS example, the browser starts loading the HTML, and then it gets to the first script tag and it has to go download, parse, and execute jquery.js. Then it has to download /events. Only after both of those two HTTP requests have fully completed can it begin to render the HTML. So in practice your page will show much more slowly. See the performance rules about scripts at the bottom and minimizing http requests for more info.

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

Sidebar

Related Questions

Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project?
Has anyone ever heard of a UNIX shell written in a reasonable language, like
Has anyone ever done work to get Ruby to do continuations (like Seaside on
Has anyone ever tried, or had any success at getting Wascana (Eclipse CDT +
Has anyone ever seen the storage class auto explicitly used in C/C++? If so,
Has anyone ever used the Bridge pattern in a real world application? If so,
Has anyone ever modified the post-new.php file in their WordPress installation? I want to
has anyone ever tried to get the list of all the movieclips (even the
Has anyone here ever used C++'s placement new? If so, what for? It looks
I'm wondering whether anyone here has ever used a skip list . It looks

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.