PDA

View Full Version : Define variables from PHP to JS



cascadeorca
01-31-2011, 02:26 PM
What I am trying to do is use:
http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

My intended goal would be to use this and define the variables in the php page I am using it on.

so have all the things defined on a variable say...

<?php
$hoverpoints = '
tooltips[1]='["1/1.jpg", "Description"]
tooltips[2]='["1/2.jpg", "Description"]
tooltips[3]='["1/3.jpg", "Description"]
tooltips[4]='["1/4.jpg", "Description"]
tooltips[5]='["1/5.jpg", "Description"]
';
?>

And then somehow having $hoverpoints do all the variables. Any help would be greatly appreciated, I'm still somewhat new to this, and in the past 7 hours of trying to fix this I've lost my mind and can't even seem to get it to function on regularly.

Thanks for anything you can come up with.