为什么request.open(" GET"," ../ Logout.aspx",true)不在这里工作? [英] why request.open("GET", "../Logout.aspx", true) not working here?
本文介绍了为什么request.open(" GET"," ../ Logout.aspx",true)不在这里工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开新窗口,如果用户关闭浏览器或标签,它正在使用window.open()方法,但这不是我想要的。
i我想打开使用request.Open()下面是我的
i want to open new window if user close the browser or tab and it is working with window.open() method but that is not i want.
i want to open using request.Open() below is my
var inFormOrLink;
$('a').live('click', function () { inFormOrLink = true; });
$('form').bind('submit', function () { inFormOrLink =
$(window).bind('beforeunload', function (eventObject) {
var returnValue = undefined;
if (!inFormOrLink) {
// this is working but i don't want it in this manner
var params = ['height=' + screen.height, 'width=' + screen.width + ',toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes'].join(',');
var popup = window.open("Logout.aspx", '_blank', params);
popup.moveTo(0, 0);
//this is not working nothing is happening here
var request = GetRequest();
request.open("GET", "../Logout.aspx", true);
request.send();
}
eventObject.returnValue = returnValue;
return returnValue;
});
不知道它有什么问题。
任何帮助我将不胜感激。
don't know what is wrong with it.
any help would be appreciated.
推荐答案
(' a').live(' 点击',功能(){inFormOrLink = true ;});
('a').live('click', function () { inFormOrLink = true; });
( ' form')。bind(' 提交', function (){inFormOrLink =
('form').bind('submit', function () { inFormOrLink =
( window )。bind(' beforeunload', function (eventObject){
var returnValue = unde罚款跨度>;
if (!inFormOrLink){
// 这是有效的,但我不想这样做
var params = [' height =' + screen .height,' width =' + screen .width + < span class =code-string>' ,toolbar = yes,location = yes,directories = yes,status = yes,menubar = yes,scrollbars = yes,copyhistory = yes,resizable = yes']。join(' ,');
var popup = window .open( Logout.aspx,' _ blank' ,params);
popup.moveTo( 0 , 0 );
// 这不能正常工作
var request = GetRequest();
request.open( GET, ../ Logout.aspx, true );
request.send();
}
eventObject.returnValue = returnValue;
return returnValue;
});
(window).bind('beforeunload', function (eventObject) { var returnValue = undefined; if (!inFormOrLink) { // this is working but i don't want it in this manner var params = ['height=' + screen.height, 'width=' + screen.width + ',toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes'].join(','); var popup = window.open("Logout.aspx", '_blank', params); popup.moveTo(0, 0); //this is not working nothing is happening here var request = GetRequest(); request.open("GET", "../Logout.aspx", true); request.send(); } eventObject.returnValue = returnValue; return returnValue; });
不知道它有什么问题。
任何帮助将不胜感激。
don't know what is wrong with it.
any help would be appreciated.
这篇关于为什么request.open(" GET"," ../ Logout.aspx",true)不在这里工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文