Created
February 18, 2017 06:49
-
-
Save kovtunos/bf720f788f7999d653ed9db023d34398 to your computer and use it in GitHub Desktop.
HTTP to HTTPS with #jquery #js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // var 1 | |
| $('a[href^="http://"]').attr('href', function(i, oldhref){ | |
| oldhref.replace("http://","https://") | |
| }); | |
| // var 2 | |
| $('a[href^="http://"]').each(function(){ | |
| $(this).attr('href', $(this).attr('href').replace("http://","https://")) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment