The following Javascript code is generated by PHP..
Now I'm guessing that all the double quotes should be escaped like
However, I'm not sure how to do this in PHP, as all of those double quotes have already been escaped..
I know you cant use \\" as that will create a T-STRING error...
Can anyone point me in the right direction?
Code:
div = document.getElementById('contentdiv');
div.innerHTML ="<div class="trigger" onClick="showBranch('branch1')">Day 1</div>
<span class="branch" id="branch1">
<a href="1">Leg 1</a><br /><a href="2">Leg 2</a><br /><a href="3">Leg 3</a><br />
";
Now I'm guessing that all the double quotes should be escaped like
Code:
div = document.getElementById('contentdiv');
div.innerHTML ="<div class=\"trigger\" onClick=\"showBranch('branch1')\">Day 1</div>
<span class=\"branch\" id=\"branch1\">
<a href=\"1\">Leg 1</a><br /><a href=\"2\">Leg 2</a><br /><a href=\"3\">Leg 3</a><br />
";
PHP:
$data .= " <div class=\"trigger\" onClick=\"showBranch('branch".$dayid."')\">Day ".$dayid."</div>\n";
I know you cant use \\" as that will create a T-STRING error...
Can anyone point me in the right direction?