How to import jquery-ui correctly

I cannot get it to work and cannot find the answers. Nothing works for me.

Did I write this incorrectly in my title?

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>

      

my code is right, it works in jfiddle but not outside of it.

+3


source to share


1 answer


When you leave a schema from a url, it uses that schema from the page that contains the url. Therefore, the tag <script>

should work if the page url http:something

or https:something

; the reason for abandoning the scheme is that it will use SSL if your page uses SSL, because browsers often complain if a secure page tries to load an unsecured script.

If you're trying to load jQuery from a local file instead of an HTTP page, you need to explicitly specify the schema http:

in the jQuery url.



<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>

      

+8


source







All Articles