重定向到使用JavaScript的aspx.page [英] Redirecting to an aspx.page using javascript

查看:123
本文介绍了重定向到使用JavaScript的aspx.page的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用JavaScript来重定向到一个aspx页面但在这attemptin我碰到下面的错误

 未捕获的错误类型。住宅'location'of对象[对象全局]是不是一个函数

使用JavaScript我如何驾驶室重定向到一个aspx页面

 函数SearchContent(){VAR txtBoxValue = $('#txtSearch)VAL()。
如果(txtBoxValue ==){
    警报(请输入一个值);
    返回false;
}
window.location的(?SearchResult所搜索=+ txtBoxValue);


解决方案

尝试

  location.href =搜索的SearchResult =+ txtBoxValue);

I want to redirect to an aspx page using javascript but upon attemptin this I get the following error

uncaught type error. Property 'location'of object[object global] is not a function

How cab I redirect to a aspx page using javascript

function SearchContent() {

var txtBoxValue = $('#txtSearch').val();  
if (txtBoxValue == "") {
    alert("Please enter a value");
    return false;
}
window.location("SearchResults?search="+txtBoxValue);

解决方案

Try

location.href = "SearchResults?search="+txtBoxValue);

这篇关于重定向到使用JavaScript的aspx.page的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆