gduncan229 Posted February 28, 2010 Share Posted February 28, 2010 I'll be honest I'm pretty new at this, but everything was going good until I tried adding javascript to the mix. I've tried a couple of fixes but everything keeps throwing me t string errors. I'm sure it's the javascript, either that or I've been doing this for too many hours. Here's the code I'm trying to print out. $str[] = "<table width=300 bgcolor=660000><tr><td onclick="DoNav('./details.php?rid=".$ID."')";\n><table width=296 bgcolor=ffffff><tr><td><img src='".$cfg['webaddress']."/images/recipes/".$WineImage."' border=0 style='height:150px;' alt=\"".$WineImage."\"></td></tr><tr><td>".$title."</td></tr><tr><td>".limitWords($description,30)."</td></tr><tr><td>".$RegPrice."</td></tr></table></td></tr></table>"; Can anyone help point out where I was an idiot? Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/193650-having-some-trouble-with-adding-javascript/ Share on other sites More sharing options...
jl5501 Posted February 28, 2010 Share Posted February 28, 2010 you need to escape some of your quotes $str[] = "<table width=300 bgcolor=660000><tr><td onclick=\"DoNav('./details.php?rid=".$ID."')\";\n><table width=\"296\" bgcolor=\"ffffff\"><tr><td><img src=\'".$cfg['webaddress']."/images/recipes/".$WineImage."' border=\"0\" style=\"height:150px;\" alt=\"".$WineImage."\"></td></tr><tr><td>".$title."</td></tr><tr><td>".limitWords($description,30)."</td></tr><tr><td>".$RegPrice."</td></tr></table></td></tr></table>"; Link to comment https://forums.phpfreaks.com/topic/193650-having-some-trouble-with-adding-javascript/#findComment-1019351 Share on other sites More sharing options...
gduncan229 Posted February 28, 2010 Author Share Posted February 28, 2010 thank you so much Link to comment https://forums.phpfreaks.com/topic/193650-having-some-trouble-with-adding-javascript/#findComment-1019357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.