Hi all,
I am learning ASP on the fly, so please bear with me. I have a page that uses a JavaScript function that when you click a link a child browser opens with the appropriate web site. I am attempting to automate this using ASP with an Access DB connecting via ADO, and I am going over this code and I think it is a quotation mark issue. First off, here is the JavaScript function:
function showNewWindow(bookURL)
{
newWindow = window.open(bookURL,"r2d2","width=450,height=350,scrollbars=yes,top=250,left=250"
;
newWindow.focus();
return false;
}
straight forward...
here is my ASP script:
<%
Dim objCommand, objRS
Set objCommand = Server.CreateObject("ADODB.Command"
objCommand.ActiveConnection = strConnect
objCommand.CommandText = "SELECT ClientName, URL FROM Clients " &_
"WHERE Status = 1 ORDER BY ClientName"
objCommand.CommandType = adCmdText
Set objRS = objCommand.Execute
Set objCommand = Nothing
While Not objRS.EOF
Response.Write "<tr height = 55><td align = center><img src = 'star.gif'></td>" &_
"<td><font face = 'Verdana, Arial, Helvetica'>" &_
"<a href="""" onClick""return showNewWindow('" & objRS("URL"
& "')"">" &_
objRS("ClientName"
& "</a></font></td></tr>"
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
%>
just for additional reference, here is the original HTML
<tr height = "55">
<td align = "center"><img src = "star.gif"></td>
<td><font face = "Verdana, Arial, Helvetica"><a href = ""
onclick="return showNewWindow(' Web Site </a></font></td>
</tr>
OK, I run the page, and the recordset returns the correct Clients, but when I click on the link, my IIS intro page appears instead of the web site needed. When I view the source of the ASP version of this page, the HTML looks correct just like in the original HTML.
I think it might have to do with all of the double quotation marks I have. I have tried all combinations, and I am not having any luck. Another bit of info: the URL's are stored in my Access DB as a Text datatype. I tried as a hyperlink, but this didn't work either.
Please point me in the right direction.
Rob
I am learning ASP on the fly, so please bear with me. I have a page that uses a JavaScript function that when you click a link a child browser opens with the appropriate web site. I am attempting to automate this using ASP with an Access DB connecting via ADO, and I am going over this code and I think it is a quotation mark issue. First off, here is the JavaScript function:
function showNewWindow(bookURL)
{
newWindow = window.open(bookURL,"r2d2","width=450,height=350,scrollbars=yes,top=250,left=250"
newWindow.focus();
return false;
}
straight forward...
here is my ASP script:
<%
Dim objCommand, objRS
Set objCommand = Server.CreateObject("ADODB.Command"
objCommand.ActiveConnection = strConnect
objCommand.CommandText = "SELECT ClientName, URL FROM Clients " &_
"WHERE Status = 1 ORDER BY ClientName"
objCommand.CommandType = adCmdText
Set objRS = objCommand.Execute
Set objCommand = Nothing
While Not objRS.EOF
Response.Write "<tr height = 55><td align = center><img src = 'star.gif'></td>" &_
"<td><font face = 'Verdana, Arial, Helvetica'>" &_
"<a href="""" onClick""return showNewWindow('" & objRS("URL"
objRS("ClientName"
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
%>
just for additional reference, here is the original HTML
<tr height = "55">
<td align = "center"><img src = "star.gif"></td>
<td><font face = "Verdana, Arial, Helvetica"><a href = ""
onclick="return showNewWindow(' Web Site </a></font></td>
</tr>
OK, I run the page, and the recordset returns the correct Clients, but when I click on the link, my IIS intro page appears instead of the web site needed. When I view the source of the ASP version of this page, the HTML looks correct just like in the original HTML.
I think it might have to do with all of the double quotation marks I have. I have tried all combinations, and I am not having any luck. Another bit of info: the URL's are stored in my Access DB as a Text datatype. I tried as a hyperlink, but this didn't work either.
Please point me in the right direction.
Rob