|
-
Nov 2nd, 2000, 10:05 AM
#1
Thread Starter
Addicted Member
Ì have the following function:
Code:
function myopen(url,name,parms) {
var handle = window.open(url,name,parms);
if (!handle.opener) handle.opener = self;
return handle;
}
I want to run this function on from ServerSide Script. I am receiving the names of html files from a querystring and I'm trying to open them when the page loads.
I want to use the the following:
[code]
myString = Request.Querystring;
myopen("myString","NEW WINDOW");
[/code}
Can someone please tell me how to use this client side function so that it runs from the server.
Thanks a lot
Johnny
-
Nov 2nd, 2000, 11:17 AM
#2
Frenzied Member
Where you want to run the client side code, you would need to simply response.write it to the page in script tags but not as a function. So you would do something like this:
myString = Request.Querystring;
'myopen("myString","NEW WINDOW");
Response.Write "<SCRIPT language=javascript>" & vbCrLf
Response.Write "var handle = window.open('myString','NEW WINDOW');" & vbCrLf
Response.Write "if (!handle.opener) handle.opener = self;" & vbCrLf
Response.Write "</SCRIPT>"
The handle variable will not, however be available to your server side script, only the other client side script on your page. (It becomes page scope)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 2nd, 2000, 11:42 AM
#3
Thread Starter
Addicted Member
Thanks a million.
Hers's the working code, if anyone else needs it.
Thanks again.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@Language=Javascript%>
<script language="javascript">
function myopen(url,name,parms) {
var handle = window.open(url,name,parms);
if (!handle.opener) handle.opener = self;
return handle;
}
</script>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
myString = Request.Querystring()
Response.write(myString())
Response.write("<SCRIPT language=JavaScript>")
Response.Write("var handle = window.open('http://200.1.20.2" + myString(1) + "','javascript_1');")
Response.Write("var handle = window.open('http://200.1.20.2" + myString(2) + "','javascript_2');")
Response.Write("var handle = window.open('http://200.1.20.2" + myString(1) + "','javascript_3');")
Response.Write("</SCRIPT>")
%>
</body>
</html>
[Edited by kanejone on 11-03-2000 at 05:15 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|