I am using the qTip jQuery plugin to create dynamic tooltips. The tooltip sends an id to cfc, which launches the request and returns the data in JSON format.
A tooltip is currently loading as follows:
{"COLUMNS:" ["BOOKNAME","BOOKDESCRIPTION"["MYBOOK","MYDESC"]]}
Here jQuery
$('#catalog a[href]').each(function()
{
var gi = parseInt($(this).attr("href").split("=")[1])
$(this).qtip(
{
content: {
url: 'cfcs/viewbooks.cfc?method=bookDetails',
data: { bookID: gi },
method: 'get',
title: {
text: $(this).text(),
button: 'Close'
}
},
api :{
onContentLoad : function(){
}
},
});
});
As I mentioned, the data is returned successfully, but I'm not sure how to output and format it using HTML.
I tried to add content: '<p>' + data.BOOKNAME+ '
'in the api :{ onContentLoad : function(){ .....to see if I can get it to output something, but I get "data undefined error"What is the correct way to try and output this data when formatting HTML?