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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:29:45+00:00 2026-05-23T21:29:45+00:00

What is faster on opening and proccecing: Having under 1 file all the jquery

  • 0

What is faster on opening and proccecing:

Having under 1 file all the jquery functions or

Each function to a separate file and call it when ever you need it?

Ex. I have a blabla.js file that has 4 functions in it.
And my xaxa.php that calls the blabla.js.

Now, when I firstly open my page its fast enough. No problem (even with cookies cleared and all)

BUT… when I first (and after) click a button that activates a part of my blabla.js all my links and functions are opening/working slower.

So should I separate my functions and load each js file where ever I need it or my problem is somewhere else?

Thank you

(As I said I start to suspect something in my structure)
So here is a sample of my jq:

$(document).ready(function(){
 $(".avoid_ref_add").click(function(){
  var keyValues = {
    pid : $(this).parent().find('input[name="pid"]').val()
    };
      $.post('help_scripts/cartfunct.php', keyValues, function(rsp){
        $('#content').load("p_body.php");
      });
 return false;
 });
function remove
function update
});

and I have my items.php items2.php items3.php…

Now, MY COOKIES I HAVE THEM CLEARED NO CACHE… When I firt open the site, it loads fast and all links are fast…

But if I click that add button everything start to work REALLY slow…

IF I just refresh the whole page it starts working fast again and so on…

FOR ME is quite strange and I cannot figure what I did wrong… Because if the page was slow, it wouldn’t load fast from the first time… Correct? Is it something in my code?

  • 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-23T21:29:46+00:00Added an answer on May 23, 2026 at 9:29 pm

    You should optimally put all your javascript in one javascript file.

    This file could be served with gzip compression and far-future expiry headers to limit bandwidth usage (and result in faster pageloads). You could even run a minimizer on your javascript to reduce file size.

    What you are really asking for is the art of minimalization/optimisation and this article is a good read: http://developer.yahoo.com/performance/rules.html

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

Sidebar

Related Questions

is opening a large file once reading it completely once to list faster (or)
I need a faster way to generate all permutations of a list, then check
I am programatically opening excel workbooks under a folder tree to check for some
We have a 120MB XML file that we want to view. Opening it in
Would it be faster include a javascript file and outputting it in the html
Is CompileAssemblyFromDom faster than CompileAssemblyFromSource ? It should be as it presumably bypasses the
Which compiles to faster code: ans = n * 3 or ans = n+(n*2)?
Apparently xrange is faster but I have no idea why it's faster (and no
Which is faster? someCondition has the same probability of being true as it has
SqlDataReader is a faster way to process the stored procedure. What are some of

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.