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>
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>