Making ajax call and showing contents in qtip

家住魔仙堡 提交于 2019-12-01 14:05:29

You could do this

$('.link').mouseover(function(){
    $.ajax(
        /* Retrieve de options for the select and fill each 
        title attribute with the information*/);
        url: "retrieveinfo.jsp",
        type: "GET",
        data: ({id : 'itemsId'}), //pass the data in JSON form
        dataType: "html",
        success: function(msg){   //msg contains the html output or you could request XML (or JSON)
            $('#info').html(msg);
            NFinit();
            tooltip.init();
        }
});

That would make one AJAX call, populate the select and init niceforms and qtip.

When you make your AJAX call to get the dropdown list content, you can also return the descriptions you want to display for each list item and affect them to the corresponding qtip.

The qtip will show onmouseover, and with the description you have set when populating your dropdown list.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!