Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

All the examples of accessing google's CDN use https:// in the URL (including on Google itself) - but this has caused a problem when testing in Safari (certificate problem and also different domain).

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

I have switched to calling it over http instead, but just wondering if this is a mistake or security issue?

share|improve this question
up vote 4 down vote accepted

You should probably just use src="//ajax.googleapis.com/..." which is a good way to allow this to work in both http and https pages.

Serving http assets in a page served via https will raise warnings in most browsers, while serving https assets in http pages usually is okay but might be "slower" because of the cryptology overhead.

share|improve this answer

You will see errors and warnings when you are including "unsecure" items on a secure page. (Vice versa) This is not a mistake or accident. It is for security reasons.

You should use the http:// version because it's a safe static file and faster.

good luck

share|improve this answer
actually, the error seemed to arise from using the secure URL for the javascript in a non-secure page... but I understand your point, and I realise the need to adapt the URL protocol to match the page... – HorusKol Jan 13 '11 at 1:15
sorry about that..i forgot to say viceversa.. good luck – andrewk Jan 13 '11 at 1:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.