I have created a page with Mysql rows displayed as a dynamicly created image grid.
The grid display i have full control over, but i need to take the (Mysql) Row ID from each image displayed and use it in a pop up of some sort.
I don’t like having a full page for each Mysql row.
It could be passing it on to a new smaller info page(dynamic) or it could be a popup with the info(dynamic).
I would prefer the popup, since i would guess this is easier on the eyes.
So what i need a suggestion on a popup function, which will load/set the row ID on click.
I have seen Jquery solutions for making popups, but i need to pass in the variables allready set by each displayed image. and this is where i fail.
Thanks in advance.
/Niels
**
This is one of the things i have tried, but i can’t really figure out the way to pass it in the right way:
echo "<p><a href=\"javascript:Popup('show.php?id=" .$row['user_id'] ')\">Show</a>"
When you render the page in PHP, you could use a data attribute
<div data-mydata='foo' />to store the ID you need. Then, with jQuery, use the data() function to access the data and render whatever popup you need.HTML 5 data attribute: http://ejohn.org/blog/html-5-data-attributes
jQuery Reference: http://api.jquery.com/data