开发者

Javascript redirect to SSL causing 'partially encrypted' error

My website's login uses AJAX to post the credentials. It then checks for an 'error/success' to be returned and then acts accordingly.

This has worked fine up until I wanted to add SSL开发者_StackOverflow.

Original code:

if (output == 'success')
   window.location=window.location;

Replacement code:

if (output == 'success')
   window.location=String(window.location).replace('http://', 'https://');

That redirects the user to the SSL'd page but it causes Firefox to present a content was partially encrypted error.

How can I use Javascript to redirect to the SSL'd page without giving a warning?


Your code looks fine.

Usually the problem is that something (Javascript library, CSS file, image, etc) on an SSL page is not using SSL.

Use the Firebug "net" tab to examine everything loaded on the SSL page. Something is being referred to using http://

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜