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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:41:30+00:00 2026-05-30T17:41:30+00:00

I am tinkering around with jQuery and am finding it very useful and almost

  • 0

I am tinkering around with jQuery and am finding it very useful and almost exciting.

As of now, I am referencing the jQuery script via Google’s CDN and I store plugins I use locally in a static/scripts directory.

Naturally, each page has its own individual implementation of components that are required for the features it currently offers. I.E. the main page has the Twitter plugin whereas the login page has form validation logic and password strength metering. However, certain components (navigation bar) for example use the same script across multiple pages.

Admittedly so, I am not a fan of putting javascript code in the header of a page, but I rather prefer to have it in an external file (for caching, re-usability, and optimization purposes).

My question is, what is the preferred route for organizing the external files. I wanted to try and keep it to one javascript file for the entire site to reduce IO requests. However, I am not sure how to implement document ready functions on a conditional per page bases.

$(document).ready(function () { ... }

Is there some way to reference a page by some method (preferably id based and not a url conditional).

Thank you in advance for your time!

  • 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-30T17:41:31+00:00Added an answer on May 30, 2026 at 5:41 pm

    You should try REQUIRE JS.

    This will allow you to load only those plugins the pages where you need them, and unload them again if they are not needed anymore.

    Then again, it might be overkill. It really depends on the size of your project.

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

Sidebar

Related Questions

I've been tinkering around with the MVVM pattern and now I'm trying to implement
I've been tinkering around with Zend-Framework and Jquery for a month or so, and
I've been tinkering around with Flex RemoteObjects, and I've found that they aren't very
I started tinkering around with HTML5 recently and am very interested in Audio tag.
I've been tinkering around with the excellent Superfish drop-down menu to fit my needs.
I have been tinkering with javasript (jquery) all day. I want to create a
I'm currently tinkering around with Workflow Foundation. I have an activity which contains the
I'm a PHP guy learning some .NET. I am tinkering around with the UpdatePanel
I have been tinkering around with ServiceStack to expose some web services and have
I've been tinkering around with PHP lately and wanted to make my own blog

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.