Ajax data to be collected in tooltip

假装没事ソ 提交于 2020-01-03 05:53:05

问题


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.

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?

Similar question was asked: How to display information returned by ajax call in a tooltip


回答1:


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.

  1. Script calls digest.jsp?params=someparameters
  2. digest.jsp fetchs the information from any domain it needs.
  3. outputs the information in a buffer in XML o JSON
  4. 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.



来源:https://stackoverflow.com/questions/4716517/ajax-data-to-be-collected-in-tooltip

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