thunderain
Programmer
Hi people:
I have been fighting with this for quite some time, should be a simple thing to do but i can't get it working. I need to send an internet link through and href, pick it up in javascript in head and open the internet page in a separate window.
This code can be copied into an asp file called "testsiteNewWindow.asp".
Here is full code:
<% @Language="VBScript" %>
<html>
<title></title>
<head>
<script language=javascript>
<!-- Begin
var pagelink;
var url;
var msgWindow;
function internetlink(pagelink)
{
url = ( pagelink );
msgWindow = window.open("","internetlink","menubar=no,scrollbars=no,status=no,resizable=yes,width=450,height=450"
msgWindow.location.href = url
};
// End -->
</script>
</head>
<body>
<%
Dim pagelink
pagelink = "Response.write "<A href='testsiteNewWindow.asp' onClick='internetlink(pagelink)'>Open Window</a>" & "</td>"
%>
</body>
</html>
If you replace:
url = ( pagelink );
with:
url = "in the javascript in the head, then it works fine, but i can't do this, i need to sent the link from the body because when i get it working i will be calling the link up from a database.
If anyone can see what's wrong, or copy code and test it, will be appreciated
thank you
thunderain
I have been fighting with this for quite some time, should be a simple thing to do but i can't get it working. I need to send an internet link through and href, pick it up in javascript in head and open the internet page in a separate window.
This code can be copied into an asp file called "testsiteNewWindow.asp".
Here is full code:
<% @Language="VBScript" %>
<html>
<title></title>
<head>
<script language=javascript>
<!-- Begin
var pagelink;
var url;
var msgWindow;
function internetlink(pagelink)
{
url = ( pagelink );
msgWindow = window.open("","internetlink","menubar=no,scrollbars=no,status=no,resizable=yes,width=450,height=450"
msgWindow.location.href = url
};
// End -->
</script>
</head>
<body>
<%
Dim pagelink
pagelink = "Response.write "<A href='testsiteNewWindow.asp' onClick='internetlink(pagelink)'>Open Window</a>" & "</td>"
%>
</body>
</html>
If you replace:
url = ( pagelink );
with:
url = "in the javascript in the head, then it works fine, but i can't do this, i need to sent the link from the body because when i get it working i will be calling the link up from a database.
If anyone can see what's wrong, or copy code and test it, will be appreciated
thank you
thunderain