PHP variables to JS

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
User avatar
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Tue Jul 05, 2005 4:52 am

Make sure you're really accessing the image file.

var pictureWidth = <?php echo $pictureWidth; ?>; whould be the better way to assign $pictureWidth to the javascript vaiable.
The Javascript error can also be related to the var pictureWidth... if no "size" was assign to it (First line).

Use error_reporting(E_ALL); so you can make sure about PHP's errors.

Also try to pass the JS code to the Body part of the HTML.
Gonçalo "gesf" Fontoura

Post Reply