如何使用Javascript在Div Click功能上重定向到另一个视图 [英] How Do I Redirect To Another View Using Javascript On Div Click Function
问题描述
大家好,
我是javascript的新手。在这里我尝试了重定向到另一个页面的代码
div id =锁定
hi all,
i am new to javascript. here i have tried the code for redirect to another page
div id =Locked
$("#Locked").click(function () {
window.location.href = "/Home/DisabledLockedUsers?userstatus=locked";
});
情况在这里我不能使用href标签所以在div中点击功能我应该重定向到另一个视图
但我也不能使用window.location.href =(因为它不支持所有浏览器),而不是这个,我需要用另一种方式所以请给我任何关于这个的想法请 b $ b
提前感谢
velsamy
situation is here i cannot use href tag so in that div click function i should redirect to anothere view
but also i cannot use window.location.href=""(because it will not support all browsers), instead of this, i need to use another way so please give me any idea about this pls
thanks in advance
velsamy
推荐答案
( #Locked)。click(function(){
window.location.href = / Home / DisabledLockedUsers?userstatus = locked;
});
("#Locked").click(function () { window.location.href = "/Home/DisabledLockedUsers?userstatus=locked"; });
情况在这里我不能使用href标签所以在div中点击功能我应该重定向到另一个视图
但我也不能使用window.location.href =(因为它不支持所有浏览器),而不是这个,我需要使用另一种方式请给我任何关于这个的想法请
提前感谢
velsamy
situation is here i cannot use href tag so in that div click function i should redirect to anothere view
but also i cannot use window.location.href=""(because it will not support all browsers), instead of this, i need to use another way so please give me any idea about this pls
thanks in advance
velsamy
可能是这个将帮助
Might be this will help
.ajax({
type:'Get',
url:'@ Url.Action(DisabledLockedUsers,Home)',
data:userstatus =locked',
complete:function(){
}
}
});
}
.ajax({ type: 'Get', url: '@Url.Action("DisabledLockedUsers", "Home")', data: userstatus="locked"', complete: function () { } } }); }
这篇关于如何使用Javascript在Div Click功能上重定向到另一个视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!