PDA

View Full Version : Variables with quotes within a quote


philliptune
11-13-2005, 05:51 PM
Man, this is frustrating me. I'm trying to use a randomizer script on some content with sub-defined attributes. e.g.: var="<tag attribute="document.image['title'].src='../img.jpg';">"

I've tried many things to clear up the "quote within a quote" problem. I've tried making (") its own variable:

dim quot=' " '
var="<tag attribute=" & quot & "document.image...>"

..but no.. it doesn't write it correctly and the script never even gets off the ground.

My question: is there a way to create a variable value that has both double and single quotes? Should show you the full script so you get the idea of what I'm wanting to do? Please help!!

_Aerospace_Eng_
11-13-2005, 06:07 PM
Escape the double quotes or use single quotes for the var
var="<tag attribute=\" & quot & \"document.image...>"


var='<tag attribute=" & quot & "document.image...>'

philliptune
11-13-2005, 06:31 PM
Aero, I could kiss you!! I've been stressing over this problem for almost a month now. I've been riding around the problem doing other stuff for the website... I knew it could be simply solved with some syntax thing but I didn't think the \" would work. I've seen it before but it seemed to not work when I'd used it for something in the past. Gosh... I can't believe i've been stressing this for so long... should have just come to you guys in the first place. This is truely the most awesome forum in the world.

_Aerospace_Eng_
11-13-2005, 07:29 PM
Aero, I could kiss you!! I've been stressing over this problem for almost a month now. I've been riding around the problem doing other stuff for the website... I knew it could be simply solved with some syntax thing but I didn't think the \" would work. I've seen it before but it seemed to not work when I'd used it for something in the past. Gosh... I can't believe i've been stressing this for so long... should have just come to you guys in the first place. This is truely the most awesome forum in the world.
For my sake please don't kiss me. :supereek: