jonniejoejonson Posted August 3, 2010 Share Posted August 3, 2010 var testVar="steve"; that works fine... but var testVar='<div class="test"><img src="test.jpg"></div>'; Is there something i can do to allow me to use html tags in a variable... regards J. Quote Link to comment Share on other sites More sharing options...
Alt_F4 Posted August 3, 2010 Share Posted August 3, 2010 You CAN store html tags in a javascript variable. What is it you a re trying to do? and what are you having problems with? Quote Link to comment Share on other sites More sharing options...
jonniejoejonson Posted August 3, 2010 Author Share Posted August 3, 2010 Thanks for the response, but i think i have solved it... I was trying to loop through a php array and convert it into javascript array. When i was looping through the php array, if it had quotes in it, then it would break, therefore by using php addslashes function it appears to solve the problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.