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

link|flag
What is "name" in the above php array? The name of the item that will get the given description? – Dan Heberden Jun 6 at 20:24
'name' is the name of the game and 'description' is the description of the game. All this is fetched from the mysql query in the code, which is in a while loop. This is how the array is being populated. – jp577 Jun 6 at 21:04

Your Answer

 
or
never shown

Know someone who can answer? Share a link to this question via email, twitter, or facebook.

Browse other questions tagged or ask your own question.