php array to jquery array to qTip plugin.
Posted
by jp577
on Stack Overflow
See other posts from Stack Overflow
or by jp577
Published on 2010-06-06T20:09:58Z
Indexed on
2010/06/06
20:12 UTC
Read the original article
Hit count: 242
Hi
I'm trying to get a PHP array to use in some jquery script using the qTip plugin. This is my array:
$descqtip[ ] = array('name' => ''.$name.'', 'description' => ''.$description.'');
Here is my jquery code:
<script type="text/javascript">
$(document).ready(function() {
var description = <?php echo json_encode($descqtip)?>;
$('#homepage_catgames h2').each(function(i){
$(this).qtip({
content: description
})
});
});
</script>
I know the above doesn't work, but i'm stuck on trying to get the description variable in each part of the array to their own individual tooltip.
Can anyone help me?
Thanks
© Stack Overflow or respective owner