N
nrocha
Hi,
I've detected a strange behaviour in my application. I'm calling a
server page through XMLHttpRequest on the onbeforeunload event.
In firefox this works great.
In IE7 the server page only gets called the first time the page is
loaded...
Here is the javascript code:
window.onbeforeunload = unlock;
function unlock()
{
var xmlHttp = null;
try {
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
try {
xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e)
{
try {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (e)
{
window.alert('Your browser does not support AJAX!');
}
}
}
try {
xmlHttp.open('GET','/DocumentationFramework/Syncronize.aspx?
action=unlock',false);
xmlHttp.send(null);
}
catch (e)
{
window.alert(e);
}
}
I have a breakpoint in the PageLoad method of Syncronize.aspx and it
only gets called the first time the window is loaded. If I close the
tab/window and open it again, the next call will be as expected, but
from there it won't work...the javascript method gets called, but the
server page don't...
Before anyone asks, I've put "false" in xmlHttp.open method because I
want to wait for the call to return.
Any sugestions?
Regards,
Nuno
I've detected a strange behaviour in my application. I'm calling a
server page through XMLHttpRequest on the onbeforeunload event.
In firefox this works great.
In IE7 the server page only gets called the first time the page is
loaded...
Here is the javascript code:
window.onbeforeunload = unlock;
function unlock()
{
var xmlHttp = null;
try {
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
try {
xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e)
{
try {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (e)
{
window.alert('Your browser does not support AJAX!');
}
}
}
try {
xmlHttp.open('GET','/DocumentationFramework/Syncronize.aspx?
action=unlock',false);
xmlHttp.send(null);
}
catch (e)
{
window.alert(e);
}
}
I have a breakpoint in the PageLoad method of Syncronize.aspx and it
only gets called the first time the window is loaded. If I close the
tab/window and open it again, the next call will be as expected, but
from there it won't work...the javascript method gets called, but the
server page don't...
Before anyone asks, I've put "false" in xmlHttp.open method because I
want to wait for the call to return.
Any sugestions?
Regards,
Nuno