1

I am developing a web application and when I try to embedd the "hosted" jquery does not work:

<script src="http://code.jquery.com/jquery-latest.js"></script>

But if I download it and call it locally like this it works:

<script src="js/jquery-1.10.2.js"></script>

It seems like when a script is called from an URL "http://..." it doesn't work when I try to go the main application:

https://myserver/appname/index.htm

I'm using ASP and Microsoft IIS. Any ideas? Thank you.

2
  • because of mixed content http and https. Oct 28, 2014 at 14:17
  • What do you see in the network tab?
    – SLaks
    Oct 28, 2014 at 14:17

1 Answer 1

2

Because you are getting mixed content warnings. The browser is not loading the http when you are on https.

Change the url to

<script src="//code.jquery.com/jquery-latest.js"></script>

which will load it to https and there should be no mixed content issue. The // is a protocol relative url so it will load the file in whatever protocol the page is loaded in.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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