Ruskin
02-25-2004, 07:54 PM
Ok, I'm new to this. Have been programming in VB so figured ASP wouldn't be difficult to pickup. But have a question;
I am trying to create a link, that opens another browser window;
<a href="http://newpage.com">New Page</a>
Opens newpage in the current browser. I was told to use a 'target' keyword, to name the browser that I wanted the page opened in, like;
<a href="http://newpage.com" target="new_window">...
This works ok, but if I click on the link again, it moves back to the browser I opened, instead of opening another browser. So I tried;
<%
response.write "<a href='http://newpage.com' target='" & RandomWindow() & "'>New Page </a>"
%>
<%
Function RandomWindow()
Dim lngCounter
Dim strReturn
Randomize
For lngCounter = 1 to 8
strReturn = strReturn & Int(Rnd * 10)
Next lngCounter
RandomWindow = "NEW" & strReturn
End Function
%>
Thus, each "target" window now has a unique name (made up of NEW and an 8 digit number). But I still only get a single browser window opening, no matter how many times I click on the link...
Is there another name that I can use in the '<a>' tag, to force a new browser window to open each time?
I am trying to create a link, that opens another browser window;
<a href="http://newpage.com">New Page</a>
Opens newpage in the current browser. I was told to use a 'target' keyword, to name the browser that I wanted the page opened in, like;
<a href="http://newpage.com" target="new_window">...
This works ok, but if I click on the link again, it moves back to the browser I opened, instead of opening another browser. So I tried;
<%
response.write "<a href='http://newpage.com' target='" & RandomWindow() & "'>New Page </a>"
%>
<%
Function RandomWindow()
Dim lngCounter
Dim strReturn
Randomize
For lngCounter = 1 to 8
strReturn = strReturn & Int(Rnd * 10)
Next lngCounter
RandomWindow = "NEW" & strReturn
End Function
%>
Thus, each "target" window now has a unique name (made up of NEW and an 8 digit number). But I still only get a single browser window opening, no matter how many times I click on the link...
Is there another name that I can use in the '<a>' tag, to force a new browser window to open each time?