本文介绍了为什么不会window.location加载一个新页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这段代码用于工作,现在它不会:

  var url = myurl +'?id ='+ id +'& phase ='+ phase; 
window.location = url;

使用IE开发工具栏我已验证url有一个有效的url,并且window.location返回新的url ...唯一的问题是页面不重新加载。

有谁知道window.location的任何原因,现在实际上加载一个新的文档分配给?

解决方案

感谢。

  document.location = url; 

为我工作。任何理由为什么窗口会停止工作?


This bit of code used to work, and now it doesn't:

var url = myurl +'?id=' + id + '&phase=' + phase;
window.location = url;

Using the IE dev toolbar I've verified that url has a valid url, and window.location returns the new url...the only problem is the page does not reload.

Does anyone know of any reasons for window.location to now actually load a new document when it is assigned to?

解决方案

Thanks to @Senad Meskin.

document.location = url;

worked for me. Any reason why window would stop working?

这篇关于为什么不会window.location加载一个新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 15:15