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

  • Home
  • SEARCH
  • 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 8820377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:35:36+00:00 2026-06-14T05:35:36+00:00

I have the below ajax call. jQuery.post(‘index.php’,{ ‘option’ : ‘com_one’, ‘controller’: ‘product’, ‘task’ :

  • 0

I have the below ajax call.

jQuery.post('index.php',{
                        'option'    : 'com_one',
                        'controller': 'product',
                        'task'  : 'loadColors',
                        'format'    : 'raw',            
                        'design_id' : design_id,
                        'collar_id' : collar_id                        
                }).success(function(result) { 
                    jQuery('div#color_wrapper').html(result); 
                }).error(function() { 
                    jQuery('div#color_wrapper').html('<h1>ERROR WHILE LOADING COLORS</h1>');
                });

Method 1
It returns large set of HTML. Then those are assigned to the div#color_wrapper. What I do here is echo all the HTML I want in the model.php.

Method 2
I just got to know that I can get the data as a JSON object and render them inside the page using a JavaScript template.(handlebarsjs).

As far I understand It’s client side processing(Method 2)vs server side processing(Method 1).

My problem is which method is faster? Which method is the industry standard? Are there any pros and cons of these two methods? What method should I use and Why?

Thanks

  • 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-14T05:35:38+00:00Added an answer on June 14, 2026 at 5:35 am

    I think the JSON method is better, since there’s less data to transfer for consecutive requests.

    If you’re really that conscious about performance, you should precompile your templates.

    Additionally, if you precompile your templates, you don’t even have to send handlebars.js to the client. You can send a much smaller handlebars.runtime.js to the browser, further decreasing load time!

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

Sidebar

Related Questions

Below is the jquery ajax call I make to the controller jQuery.post('index.php',{ 'option' :
I have written below code to make an ajax call using jquery: $.ajax({ url:
I am getting strange behavior, below is the jquery ajax call to my page.
I have a jQuery script to change background image with respect to ajax call
I am trying to achieve a JQuery AJAX call to a controller action method
I am trying to call a PHP function using AJAX. Below is the script
I have an ajax call in jQuery loading some elements into a div. The
I have the below jQuery code: $(document).ready(function () { $('#ajaxButton').click(function () { $.ajax({ url:
I have an ASP.Net MVC 3 application that uses a jQuery .ajax call to
I have JavaScript of ajax uploader as below; $(document).ready(function(){ var qwerty = $('#qwerty').val(); $('#demo1').ajaxupload({

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.