Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 0 down vote accepted

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
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
add comment

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
add comment

Your Answer

 
discard

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.