我应该如何着手实现如下: 我需要从另一台服务器是一个jsp页面中有涉及到我想要的工具提示显示的信息的数据获取数据。在code表示这是工作,我可以做AJAX调用获得响应。
How should I proceed in achieving the following: I need to get the data from another server which is a jsp page it has the data related to the information i want to show in tooltip. The code for this is working and I can make ajax call to get the response.
令人担忧的是,我想qtip库的内容以适应页面,因为该页面不允许跨域的内容。如果我会尝试只是参考qtip保存在我的网站上的内容(所访问的从我使用的页面不同),它不会允许这样做。因此,它是精细嵌入内容的主要形式还是有一些其他的最佳方式?
The concern is that I want the contents of qtip library to fit in the page since the page doesn't allow cross domain contents. If I will try to just reference the contents of qtip saved on my website(the domain is different from the page which I am using) it wont allow to do this. so is it fine embedding the contents in the main form or there is some other optimal way?
类似的问题,有人问: How显示由Ajax调用的工具提示返回的信息
Similar question was asked: How to display information returned by ajax call in a tooltip
如果您无法通过AJAX实现跨域你总是可以使用一个中介的脚本(在你的情况下,Java)来输出包含要在信息的缓冲区该qTip。
If you can't reach cross domain via AJAX you can always uses an intermediary script (in your case Java) to output a buffer containing the information you want in the qTip.
脚本调用 digest.jsp?PARAMS = someparameters
digest.jsp去抓取来自它所需要的任何领域的信息。
在输出ØJSON在缓冲区内的信息以XML
用JavaScript您解析信息的把它放在选项属性。
Script calls digest.jsp?params=someparameters
digest.jsp fetchs the information from any domain it needs.
outputs the information in a buffer in XML o JSON
with javascript you parse the information an put it in the option attribute.
如果它不为你工作,也不要做到这一点,你可以随时传递在把信息中的每个标题中的每个选项
。
If it doesn't work for you nor you want to do it you can always relay in putting the information in each title=""
attribute in each option
.