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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:13:25+00:00 2026-05-28T00:13:25+00:00

I have been using the following code for loading JQuery in all of my

  • 0

I have been using the following code for loading JQuery in all of my projects. I grabbed it from http://html5boilerplate.com/. There is extensive disussion of this technique here.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery-1.7.1.min.js"><\/script>');</script>

This code works great and seems pretty darn quick once I’ve put it up on the interwebs, but when I open my .html file locally it takes ~10 seconds per refresh. Generally I get fed up and alter the code as follows:

<!-- uncomment when going live 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery-1.7.1.min.js"><\/script>');</script>-->

<!-- remove following line when going live -->
<script src="jquery-1.7.1.min.js"></script>

Am I missing something obvious here? I feel like I should not be getting the super-slow loading times, but it does resolve itself when comment out those lines.

  • 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-28T00:13:25+00:00Added an answer on May 28, 2026 at 12:13 am

    I’m guessing that you’re not serving the HTML through a web server.

    The // prefix on the url indicates that it should use the same protocol as the current resource (usually either http or https)

    Since you’re not serving through http and instead through a file, it’s trying to look for it on your local file system, eventually timing out.

    The network tab on Chrome inspector shows it trying to load the following for me:

    file://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
    file:///C:/Users/[My Username]/Documents/jquery-1.7.1.min.js

    It’ll try to load those times and the file system (or maybe the browser) will eventually timeout.

    The proper way is to serve it through a web server, either IIS if you’re on Windows or Apache if you’re on Linux/Mac (Apache also works in Windows, but IIS has better UI tools)

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

Sidebar

Related Questions

I have been using the following code to obtain a simple web response from
I have been using the following code (with jQuery v1.4.2) to set the 'selected'
I have been using the following preload script to load all the images and
I have been using the following code to query one table: public Cursor fetchFilteredItemsNearSortedByDistance(String
I have been using the following code for quite some testing now and havent
I have been told to start using Classes and Namespacing in my jQuery code
I have been using the following code for months (without problem) in a .NET
I am using the following code for the Share Price Application I have been
I have been using the following CSS to apply an effect at the bottom
Ok, I have been using the following script for over a year now to

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.