pmoore Posted June 3, 2008 Share Posted June 3, 2008 I'm a complete newb. I'm trying to pop-up a tell a friend script, here's the block: echo "<td valign=\"center\">"; echo "<div style='width:100%; height:100%; vertical-align: center;'>"; echo "<a href=\"javascript:newWindow('sendemail.php?'+document.location.href,'email',400,300,'') 'style=display: block;'>"; echo "<span>"; echo "<img src=\"".$mosConfig_live_site."/components/com_marketplace/images/system/writead.gif\" border=\"0\" align=\"top\" >"; echo "</span>"; echo " "; echo "<span>"; echo JOO_TELL_FRIEND; echo "</span>"; echo "</a>"; echo "</div>"; echo "</td>"; Here's the result: The link appears, but when I click on it nothing happens and Firebug says: missing ; before statement newWindow('sendemail.php?'+document.location.href,'email',400,300,'') 'style=dis... Also, the image doesn't appear in front of it. I really appreciate any help! Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 3, 2008 Share Posted June 3, 2008 That's a Javascript error Quote Link to comment Share on other sites More sharing options...
pmoore Posted June 3, 2008 Author Share Posted June 3, 2008 Is it an error in the script or in the php file I'm trying to add this to? I appreciate your help.... Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 3, 2008 Share Posted June 3, 2008 Not sure because I can't see your JS source, but, take off the trailing comma of the window dimensions. It shouldn't be there. Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 3, 2008 Share Posted June 3, 2008 Well, it's a JavaScript error because the PHP is not formatted correctly (By the way it is Javascript not Java). The problem is onthis line echo "<a href=\"javascript:newWindow('sendemail.php?'+document.location.href,'email',400,300,'') 'style=display: block;'>"; Try this: <?php echo "<td valign=\"center\">"; echo "<div style='width:100%; height:100%; vertical-align: center;'>"; echo "<a href=\"javascript:newWindow('sendemail.php?'+document.location.href,'email',400,300,'')\; style=\"display: block;\">"; echo "<span>"; echo "<img src=\"".$mosConfig_live_site."/components/com_marketplace/images/system/writead.gif\" border=\"0\" align=\"top\" >"; echo "</span>"; echo " "; echo "<span>" . JOO_TELL_FRIEND . "</span>"; echo "</a>"; echo "</div>"; echo "</td>"; ?> Quote Link to comment Share on other sites More sharing options...
pmoore Posted June 3, 2008 Author Share Posted June 3, 2008 The image appears now, thanks mj. The newWindow doesn't appear though, and Firebug says: illegal character newWindow('sendemail.php?'+document.location.href,'email',400,300,'')\; style= Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 3, 2008 Share Posted June 3, 2008 I forgot the double quote after that slash before the style attribute. All you need to do is LOOK at the HTML in the generated page and see where the error is. Use whatever debugging info you have (Firebug, IE, etc) and figure out what wasn't properly formatted and fix it. Quote Link to comment Share on other sites More sharing options...
pmoore Posted June 3, 2008 Author Share Posted June 3, 2008 Works great. Sorry to be a pain, and thank you for your help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.