Click to See Complete Forum and Search --> : Window open causes The requested resource is in use.


wayneclements
07-29-2003, 04:13 AM
I have some simple JavaScript to conditionally drive my users around some small ASP pages. My JavaScript is below.

The aim is to divert to different pages according the the current evironment.

The problem is that I consistently get an Error window containing the message "The requested resource is in use."

I inserted some alert('hi') type statements just before the showDialog and window.open statements and the problem goes away, but I can't use it like that.

What is the alert() doing that makes it OK?

What can I do to make it work?

Many Thanks
Wayne

My Javascript looks like:

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function window_onload() {

var target = '<%=Session("TargetFileName")%>'

var email = '<%=Session("LoginEmailAddress")%>'

if ((email == '') || (email == undefined)) {
if (navigator.appName.indexOf('Microsoft') != -1) {

var str = window.showModalDialog('StevesForm.Asp','Dialog Box Arguments #1', 'dialogHeight: 486px; dialogWidth: 506px; help: No; resizable: No; status: No')

if (str != 'ok') {
window.history.go(-1);
} else {
window.navigate(target);
}
}

if (navigator.appName.indexOf('Netscape') != -1) {
var here = window.name
var str = window.open('StevesForm.Asp?target='+target,here)
}
} else {

window.navigate(target);

}

}

//-->
</SCRIPT>

xataku_nakusute
07-29-2003, 04:16 AM
if ((email == '')

is that supposed to be:

if ((email == "")

?

wayneclements
07-29-2003, 04:26 AM
Thanks for looking at my problem. I'm desperate.

It's supposed to be

If var email is undefined or empty then do something else some other thing

if ((email == '') || (email == undefined)) {

something

} else {

some other thing

}

Wayne

wayneclements
07-29-2003, 04:34 AM
I'm sorry I forgot to mention a few observations:

(1) Problem occurs in MSIE and Netscape

(2) If after I have the "The requested resource is in use." error, I hit the RELOAD / REFRESH button the correct pages loads.

Thanks
Wayne

xataku_nakusute
07-29-2003, 06:05 AM
may i see the page?