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! Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/ Share on other sites More sharing options...
Jabop Posted June 3, 2008 Share Posted June 3, 2008 That's a Javascript error Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556703 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.... Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556705 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. Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556708 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556711 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= Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556718 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. Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556731 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! Link to comment https://forums.phpfreaks.com/topic/108567-echo-java-pop-up-in-php/#findComment-556733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.