jfergy
asked on
Double to single to double quotes
Hello-
Where it says "<%=getdata("description") %>", may have single quotes inside. How can I keep Javascript from erring out when it sees that inside the string? Do I need double quote twice then single outside or?
Thanks
<img src="yourSrc" name="Photo" />
<span id="PhotoDescription"></sp an>
ONMOUSEDOWN="document.imag es['Photo' ].src='/my pictures/p ic.jpg'; document.getElementById('P hotoDescri ption').in nerHTML = '<%=getdata("description") %>';"
Where it says "<%=getdata("description")
Thanks
<img src="yourSrc" name="Photo" />
<span id="PhotoDescription"></sp
ONMOUSEDOWN="document.imag
You should use an asp function, in php there i mysql_real_escape_string($ descriptio n) let me see if there is a simliar function for ASP.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that worked great. I made it a little simpler though:
<%=Replace(getpix("Descrip tion"), "'", "\'")%>
<%=Replace(getpix("Descrip
Hehe, nice thinking, I'm no good with ASP, I am a php guy =)
ASKER
Thanks for the help. I used php quite a while ago until Microsoft servers caught up to the usability of apache. Now im just MS.