Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<% response.write "<a href.. window.open -syntext

Status
Not open for further replies.

mici

Programmer
Jun 2, 2003
36
0
0
IL
I get an error msg no matter what i try-
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'

I am trying the following syntext:
<%Response.Write ("<a href=""" language=""javascript"" onmouseover =""window.open("'file.asp?Id=" & paramId & "' , 'file', 'width=400,height=200,scrollbars=yes')"">bla bla </a>")%>
 
There are a couple of problems. Here's what needs to change (no promises that it's valid code, though):
Code:
<%Response.Write ("<a href="""[COLOR=red]"[/color] language=""javascript"" onmouseover =""window.open([COLOR=red][s]"[/s][/color]'file.asp?Id=" &  paramId & "' , 'file', 'width=400,height=200,scrollbars=yes')"">bla bla </a>")%>
Kinda hard to tell, but that's a strikethrough on that second red double-quote. Here it is changed:
Code:
<%Response.Write ("<a href="""" language=""javascript"" onmouseover =""window.open('file.asp?Id=" &  paramId & "' , 'file', 'width=400,height=200,scrollbars=yes')"">bla bla </a>")%>
In the first error, remember that two double-quotes in a row becomes a literal double-quote, so you need 4 if you want 2. The second error is just an extra double-quote.
 
Thanks ! it worked.
I have 2 more issues in this matter:
1. when the popup window is opened, the original screen (that calls the popup) changes to the root page , while it needs not to be changed.

2. How do I make the text of the href not be underlined, but still be clickable to the popup window?

Thank you so much
 
1. I don't know, I've never seen that. Sounds like a strange Javascript problem. Maybe the folks in the Javascript forum can help you, forum216.

2. Use CSS style sheets to remove the line. The folks in the CSS forum can tell you how, forum215.

PS: You'll save yourself a lot of quoting hassle in the future if you just turn off ASP tags for the line and user inline ASP for your variable, like this:
Code:
%>
<a href="" language="javascript" onmouseover ="window.open('file.asp?Id=<%=paramId%>' , 'file', 'width=400,height=200,scrollbars=yes')">bla bla </a>
<%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top