Need help formatting url

S

sklett

Hi

I have code that writes links, these links call a javascript function and
pass in a url.
So let;s say I have a client side function like this

function DoIt( url )
{
alert(url);
}

Then, in my server script I have
Response.Write("<br>")
response.write( "<a href='javascript:DoIt(" )
response.write( "'Detail.asp?Doc=" )
response.write( Docs(i) )
response.write( "')" )
response.write( "'>" )
response.write( PullNameFromPath(Docs(i)) )
response.write( "</a>"&vbcrlf )


Where Docs(i) is an array of links

The problem is, I need to send the url to the javascript function as a
string, but I can't figure out how to wrap it in ' ' characters without
terminating the <a> tag. For example, this won't work:
javascript:SetParentLocation(Detail.asp?Doc=/doc_root/sk_files/hanna in a
word file.doc)

Basically, the above server side code gives me a link like this:
javascript:SetParentLocation(


This has to be an easy one, but I'm tired and feeling stupid ;)

Thanks for any help!
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top