Jump to content

Having some trouble with adding javascript


gduncan229

Recommended Posts

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

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.