Zen Cart Logo
Forums / General Questions / Need Help Escaping Quotations

Need Help Escaping Quotations

Views: 565

Results 1 to 4 of 4
28 Apr 2012, 6:07 PM
#1
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

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

28 Apr 2012, 6:11 PM
#2
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Need Help Escaping Quotations

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..

28 Apr 2012, 6:27 PM
#3
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

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.

28 Apr 2012, 6:53 PM
#4
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

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.