使Ajax调用,并显示在qtip内容 [英] Making ajax call and showing contents in qtip

查看:79
本文介绍了使Ajax调用,并显示在qtip内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写$ C $下的下拉列表。下拉列表正在从来自数据库的数据填充。所以,我提出2 AJAX调用一个是事件的onmouseover填充的下拉列表中的内容,另一次选择特定的选项,使得AJAX调用带来的相关内容在屏幕上。

I am writing code for a dropdown list. The dropdown list is being populated from the data from the database. So I am making 2 ajax calls one is on event onmouseover to populate the contents of dropdown list and the other on selection of specific option making ajax call to bring related contents on the screen.

现在我不想再拍AJAX调用来获取可填充在鼠标悬停在特定的选项内容。内容得到了来自Ajax调用可以显示在小对话框。为了实现这一点,我已经安装了qtip库。

Now I want to make another ajax call to get the contents which can be populated on hovering over the specific option. The contents got from ajax call can be displayed in the small dialog box. For achieving this I have installed the qtip libraries.

问题

我没有收到Ajax调用怎么做。这甚至将适合实现这一?我知道qtip是页面的加载onload事件。但是,因为我要让Ajax调用得到消息的内容显示在上空盘旋选项。有什么建议?

I am not getting how the ajax call be made. Which even will be appropriate for achieving this? I know the qtip is loaded onload of the page. But since I want to make ajax call to get the contents of the message to be shown on hovering over the option. Any suggestions?

我也看到的地方,你不能在同一时间做超过2 Ajax调用。

I have also read somewhere that you can't make more than 2 ajax calls at a time.

**的3 AJAX调用的内容不同。我有单独的JSP文件为他们每个人。

** The contents for the 3 ajax calls are different. And I have separate JSP files for each of them.

推荐答案

您可以做到这一点。

$('.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();
        }
});

这将做一个AJAX调用,填充选择和init nicef​​orms和qtip。

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

这篇关于使Ajax调用,并显示在qtip内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆