dpawon

Javascript Function Replace http to https

Oct 28th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.26 KB | None | 0 0
  1. <script type='text/javascript'>
  2. function toHttps(link) {
  3.   if(link.indexOf('http://') > -1){
  4.     var url=link.replace('http','https');
  5.     return url;
  6.   }
  7.   return link
  8. }
  9. </script>
  10.  
  11. <a href="https://www.dpawoncatering.com/">www.dpawoncatering.com</a>
Advertisement
Add Comment
Please, Sign In to add comment