vytas Posted January 23, 2007 Share Posted January 23, 2007 I want to get quotes this sign = " Into a javascript variable something like thisvar image = new Array()image[1] = "<img src="<-- thats the problem.image[2] . and so further. Link to comment Share on other sites More sharing options...
Skemcin Posted January 23, 2007 Share Posted January 23, 2007 image[1] = "<img src="should beimage[1] = "<img src='alternately use single and double quotes when they get nested inside each other. this will be the case for really any programming language. Link to comment Share on other sites More sharing options...
vytas Posted January 23, 2007 Author Share Posted January 23, 2007 So will the single quote act the same like the double quote will ? Link to comment Share on other sites More sharing options...
aspnetguy Posted January 23, 2007 Share Posted January 23, 2007 actually I would use image[1] = '<img src=" instead to keep with good markup.you could also do thisimage[1] = "<img src=\"the url\" alt=\"alt text\">" Link to comment Share on other sites More sharing options...
Sniffy Posted January 23, 2007 Share Posted January 23, 2007 Or rather... :)image[1] = '<img src=\'the url\' alt=\'alt text\' />';But as you said, that avoids good mark-up Link to comment Share on other sites More sharing options...
Chocolate570 Posted January 24, 2007 Share Posted January 24, 2007 Wait, Skemcin-can you nest them without escaping? E.g.document.write("Hello, and then I said 'Hey! you know what he said? he said "blahblahblah" yeah, that's what he said!' hey") Link to comment Share on other sites More sharing options...
aspnetguy Posted January 24, 2007 Share Posted January 24, 2007 Wait, Skemcin-can you nest them without escaping? E.g.document.write("Hello, and then I said 'Hey! you know what he said? he said "blahblahblah" yeah, that's what he said!' hey")no you can't Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now