防钓鱼验证

某些钓鱼网站提供的URL和网页本身的URL是不一致的,你可以用下面的代码进行验证,当两个URL相差太大的时候,你就要稍加小心了:

javascript:alert("The actual URL is: " + location.protocol + "//" + location.hostname + " The address URL is:" + location.href + " If the server names do not match, this may be a spoof.");


下图是对中国银行的测试,当然,仅当娱乐哦!

[img]/upload/attachment/103927/73686a51-05d9-3671-b0fe-e366bccd021c.jpg[/img]

你可能感兴趣的:(家有妙招,JavaScript)