如何在工具提示中显示ajax调用返回的信息
我创建了一个 JSP 文件,它返回数据库所需的信息。我还编写了代码,该代码将对该 jsp 文件进行 ajax 调用以检索信息。但我没有得到任何好的或免费的工具提示库来知道如何将此信息放入工具提示中。请推荐 javascript 中好的、免费的工具提示库(我不擅长 jquery,我知道它很强大,但我需要学习和更改我的整个代码)。
问题:我需要将鼠标悬停在列表视图的不同选项上时显示此工具提示内容。 (列表视图的每个选项都会有不同的信息)在每个选项上移动鼠标时,应该向 JSP 页面发送一个 ajax 调用,并将预期的调用返回到工具提示中)我现在使用 javascript 代码进行 ajax 调用并从 JSP 获取内容文件中唯一的问题是要使用哪些 Tootip 库以及如何将它用于列表视图的每个选项。请建议。
I have created a JSP file which returns the information required from database. I have also written code which will make ajax call to this jsp file to retrieve the information. But I am not getting any good or free Tooltip libraries to know how to put this information into tooltip. Kindly suggest good and free libraries of tooltip in javascript( I am not good in jquery I know its powerful but I need to learn and change my whole code).
Problem: I need to show this tool tip contents on hovering the mouse on different options of listview. (each option of listview will have different infrormation) On moving mouse on each option should send an ajax call to the JSP page and get the intended calls back into the tooltip) I now the code of javascript to make ajax calls and get contents from JSP file the only problem is which tootip libraries to use and how to use it for each option of listview. Kindly suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
qTIP 就可以了。去图书馆。将其配置为您需要的标签。其余的可以这样进行:
document.getElementById(id).setAttribute('title', 'Ajax response here');
库会为您完成剩下的工作。
要避免 AJAX 调用的问题,您可以使用以下检查:
编辑:在库中搜索
var qTipTag = "a,label,input";
并将其更改为var qTipTag = " li,a,标签,输入";
。这将启动您想要的标签的工具提示引擎。你可以在这里看到它的工作 http://jsfiddle.net/DarkThrone/gu6T2/5/
qTIP will do the trick. Get the library. Configure it for the tags that you need. The rest could follow like this:
document.getElementById(id).setAttribute('title', 'Ajax response here');
The library would do the rest for you.
To circumvent the problem of the AJAX call you can use this check:
Edit: Inside the library search for
var qTipTag = "a,label,input";
and change it tovar qTipTag = "li,a,label,input";
. This would start the tooltip engine for the tags you want.you can see it working here http://jsfiddle.net/DarkThrone/gu6T2/5/