This topic is locked

Hyperlink Popup

10/15/2004 11:42:02 AM
ASPRunnerPro General questions
author

Hello!
Just a quick problem;
How do you turn the hyperlink string to open link in a popup. I can make the link appear in a new page but not control the toolbars, size etc.
The unedited code from aspfunctions.asp;
GetData = "<a href=""" & str & """>" & strTitle & "</a>"
to open in a new window is
GetData = "<a href=""" & str & """target=_blank>" & strTitle & "</a>"
So how do we add window attributes?
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no,copyhistory=no,width=100,height=100'
Best,
Martin

501102 10/15/2004

Martin,
I hope you don't mind I give you my answer. I don't work for the company that makes ASPRunner, I'm just another user like yourself but I think I know how to solve your problem.
First, here is a listing of a sample web page that does what you are asking...
<html>

<head>

<title>Display link in pop up window</title>

<script language="javascript">

 function myWin(myurl){

   window.open(myurl, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=no,copyhistory=no,width=200,height=200');

 }

</script>

</head>

<body>

<a href="javascript:myWin('testlink.html');">mytest</a>

</body>

</html>[/code]

You will want to duplicate this functionality. In the ASPFunctions.asp file and change...
to...
[color=blue]

GetData = "<a href=" & Chr(34) & "javascript:myWin('" & str & "');" & Chr(34) & ">" & strTitle & "</a>"


note that I prefer to use Chr(34) instead of the way ASPRunner uses """. I find it is easier to read.
Also be careful if you try typing this yourself since we need to use a single quote to surround the url stored in str. So what you should type myWin( ); etc...
You would also then need to include the script code into the jsFunctions.js file. So cut and paste...
[color=blue]

 function myWin(myurl){

   window.open(myurl, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=no,copyhistory=no,width=200,height=200');

 }



note: without the <script></script> tags
and paste into jsFunctions.js
Hope this works for you. Since I don't have this functionality in my own pages I haven't completely tested this but it looks like it should work.
Good luck,

Dan <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=2662&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

501103 10/15/2004

Hi Dan,
Thanks very much for your reply, works perfectly!! I salute you hehe <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=2663&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />
Cheers,
Martin