问题描述
|
我正在使用
document.URL
函数通过javascript加载网页。它在IE中可以正常工作,但是chrome和firefox会带来问题。什么都没有重新加载。还有其他方法吗?
我传递的命令是
document.URL = \'samplepage.PHP\';
解决方法
location.href=\"samplepage.php\"
, 为了使Chrome兼容,您需要确保指定了协议,否则href将相对于当前路径。
url = \'google.com\'
window.location.href = \'http://\'+url;