I am trying to make a link open up a popup window when clicked and I am getting an error. This was working fine when I just did an href to another page but once I added in this java code to go to a popup window I started getting an error. I do not know enough about it to know what it is I need to fix to make it work. I would appreciate any help.
<?php if($custom_27 != '') { echo '
<div id="listing_offer">'.'<a href="JavaScript:newWindow('/terms_of_service.php','popup',550,450,'')">'.$custom_27.'</a>'.'</div>'; } ?>
Error that I get:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/tuls**/public_html/**/**/***.tpl on line 32
Parse Error
Moderator: General Moderators
Re: Parse Error
Your echo statement has a comma in it and you need to escape the single quotes in your javascript.
Code: Select all
<?php
if($custom_27 != '') {
echo '<div id="listing_offer"><a href="JavaScript:newWindow(\'/terms_of_service.php\',\'popup\',550,450,\'\')">$custom_27</a></div>';
}
?>
-
tulsaimagery
- Forum Newbie
- Posts: 2
- Joined: Tue Jul 06, 2010 2:57 pm
Re: Parse Error
Thanks I got it working