Monday, January 9, 2012

Is it possible to change the base href of a page with JavaScript?

So I have this problem with Network Solutions. The shopping cart we're using relies on the base href to be changed when switching to SSL to https://, if it detects it's in SSL mode. But NetSol runs their SSL through a proxy, so the cart can't tell if it's in SSL or not. So, is there a way to detect with JS if the URL of the page is https://, and if so, change the base href from http to https? Sort of like str_replace in PHP? I'm not a whiz at PHP or JS...

No comments:

Post a Comment