Need Help Escaping Quotations
OK been on this all afternoon and there comes a time when I have to accept that Ive been beat!
I hope someone can help me, I need to add a rel tag to a href in the following code:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
essentially it needs to be:
rel="$thumb_slashes"
I have tried all manor of combinations of escaping and nothing seems to be working :(
for example:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')" rel=\"' . $thumb_slashes . '>' . $thumb_slashes . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
Hoping someone with bit more of a code head can provide me the solution.
Thanks.
Phil
Re: Need Help Escaping Quotations
Quote:
Originally Posted by
philip937
OK been on this all afternoon and there comes a time when I have to accept that Ive been beat!
I hope someone can help me, I need to add a rel tag to a href in the following code:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
essentially it needs to be:
rel="$thumb_slashes"
I have tried all manor of combinations of escaping and nothing seems to be working :(
for example:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')" rel=\"' . $thumb_slashes . '>' . $thumb_slashes . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
Hoping someone with bit more of a code head can provide me the solution.
Thanks.
Phil
incase you wondered the man with his tongue out is actially where there is a : and p next to eachother..
Re: Need Help Escaping Quotations
You should not be adding rel tags inside the body tag.
What are you trying to achieve? There are other ways to invoke JS in zencart.
Re: Need Help Escaping Quotations
I happen to disagree with you.
http://www.w3schools.com/TAGS/att_a_rel.asp
It's required for scripts that deal with large image on hover.
I'd appreciate direction as per my original question someone please.