|
-
October 23rd, 2006, 11:25 AM
#1
Java Script in ASP
This may sound a bit odd, but I am trying to mix JavaScript onclick event into ASP.
I have ASP code to make a list of links from a database, that code looks like this
Code:
Response.Write "<a href=""" & recordset("url") &""" title=""" & recordset("name") &""">" & recordset("name") & "</a>"
Is it possible to have the same kind of system that uses this JavaScript
Code:
<a href="URL"
onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;" title="Name">Name</a><br>
I can never get the " and ' bits right
-
October 23rd, 2006, 01:11 PM
#2
Re: Java Script in ASP
I assume the bolded parts are where you want the ASP to take over. Try...
Code:
<a href="<% Response.Write URL %>"
onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;" title="<% Response.Write NAME %>"><% Response.Write NAME %></a><br>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
October 23rd, 2006, 02:24 PM
#3
Re: Java Script in ASP
Yes the bold parts are where the record set bits are in the other bit of code I posted.
I will give the above a try.
-
October 23rd, 2006, 02:32 PM
#4
Re: Java Script in ASP
Great, got it working, thanks
-
October 23rd, 2006, 03:29 PM
#5
Re: Java Script in ASP
You're welcome. Glad to help.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|