How can I change every http to https using JavaScript in source code? -
i change every instance of http https using javascript. how can this? source code like?
anyway, assume after in tags, should easy extrapolate others:
if (document.location.protocol === 'https:') { $('a').each(function() { var href = $(this).attr('href'); if (href.indexof('http:') > -1) { href = href.replace('http:', 'https:'); $(this).attr('href', href); } }); }
Comments
Post a Comment