use*_*174 3 html javascript window.open
我是javascript的新手,编写了一个程序,它将打开一个查询字符串作为链接.
我使用了window.open(),但链接在新选项卡
中打开,我想在同一个选项卡中打开此链接.
代码如下.
var strquerystring;
if(fromvalue==""||tovalue==""){
alert('kindly fill all the details');
}else{
window.open(strquerystring);
}
Run Code Online (Sandbox Code Playgroud)
小智 7
使用
location.href = strquerystring;
Run Code Online (Sandbox Code Playgroud)
而不是window.open.然后它将更改当前的URL.
| 归档时间: |
|
| 查看次数: |
21714 次 |
| 最近记录: |