When you load the page into HTTPS jsFiddle wants to ensure that the loaded content is also in HTTPS, but the external code you are loading is in HTTP. So jsFiddle does not load this code and hence "does not work".
If you open the console you see some mistakes. 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 explaining what I wrote above:
Mixed Content: The page at 'https://fiddle.jshell.net/evertramos/ag9p2tvj/6/show/' was Loaded over HTTPS, but requested an insecure script 'http://igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js'. This request has been blocked; the content must be served over HTTPS.
If you change this external reference to HTTPS, the url will be: https://igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js
, then it will work.
Or as @Onosendai pointed out: "if the reference is amended to //igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js
(ignoring the protocol) the code will work in the environment; the browser will try to solve the correct protocol".
Cool @Sergio, thanks!
– Evert
@Evert only complementing Sergio’s (correct) answer - if the reference is changed to
//igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js
(ignoring the protocol) the code will work in the environment; the browser will try to solve the correct protocol.– OnoSendai
@Onosendai well seen.
– Sergio
@Cool Onosendai! Even though https works in http environment, at least in Fiddle, I think it is the best option Onosendai. Thank you for supplementing.
– Evert