jQuery code works on 'http': //jsfiddle.net but does not work on 'https': //jsfiddle.net

10

asked by anonymous 12.05.2015 / 19:29

1 answer

10

When you load the page in HTTPS, jsFiddle wants to ensure that the loaded content is also on HTTPS, but the external code you are loading is in HTTP. Then jsFiddle does not load this code and hence "does not work".

If you open the console you will see some errors. One of them $(...).mask is not a function is because the method does not exist since the external file was not loaded. The other is exactly to explain what I wrote above:

  

Mixed Content: The page at ' link ' was loaded over HTTPS, but requested an insecure script ' link '. This request has been blocked; the content should be served over HTTPS.

If you change this external reference to HTTPS, getting url: https://igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js , then it will work.

Or //igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js (bypassing the protocol) the code will work entirely from the environment; the browser will try to solve it"% A3o-works-in-https / 63543 # comment129817_63543 "> the correct protocol ".

jsFiddle: link

    
12.05.2015 / 19:41