I keep getting ILLEGAL STRING
or ILLEGAL TOKEN
. Any thoughts? I imagine this is an escaping issue, but have not found the correct solution.I am escaping the single quotes as other code is escaped in the same area.
I have tried:
escaping the special characters like
&
as well."Heredoc" and believe this is part of my solution, but still getting the errors.
Here is the code:
<?php
$STRING .='
<script type="application/javascript">
function onPictureChanged()
{
var href="http://pinterest.com/pin/create/button/?url="\' + encodeURIComponent(location.href.replace(location.hash, "")) + \'"&media="\' + $(\'#fullResImage\').attr(\'src\');
jQuery(\'.pp_social\').append(“<div class=\'pinterest\' ><a href=\'”+ href +”\' class=\'pin-it-button\' count-layout=\'horizontal\' target=\'_blank\'><img border=\'0\' src=\'http://assets.pinterest.com/images/PinExt.png\' title=\'Pin It\' /></a></div>”);
}
</script>';
echo $STRING;