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?


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.


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

  • 2
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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