storing an span content to a variable without getting an error
I'm trying to embed a lot of html code into a javascript variable. How do I do that without getting error?
I kinda think that it has something to do with the escape quotation plus x, which I need so that the id won't duplicate.
is there a better way to do this?
Thanks
- //add new form
- //update cached steps in the wizard with a new step (adds one first)
- $(".addcar").live(click,function(){
- //step 2 vehicle information content
- if (x == null)
- {
- var x = 0;
- }
- var vcontent = '<span id="vehicle/" + x + /"" class="step">
- //plus a lot of content
- </span>';
- var icontent = '<span id="insurance/" + x + '"" class="step">
- <span class="title">Step 3 - Select an Insurance</span><br/>
- //plus a lot of content
- </span>
- </span>';
- $("#review").before(vcontent);
- $("#review").before(icontent);
- $("#signupForm").formwizard("update_steps");
- x += 1;
- $(this).attr('disabled','disabled');
- });