开发者

content in tooltip

开发者 https://www.devze.com 2022-12-21 04:48 出处:网络
I have tooltip(prototip, but it doesnt matter) on my page in javascript and I want when user mo开发者_StackOverflow中文版ve on word, where is tooltip, generate tooltip content with string from my prox

I have tooltip(prototip, but it doesnt matter) on my page in javascript and I want when user mo开发者_StackOverflow中文版ve on word, where is tooltip, generate tooltip content with string from my proxy-server...so probably when I move on word where is tooltip, javascript send request on proxy server and get response with string content - from this response javascript get this string and show. It is possible? How?


Prototip can do that out of the box. Check out the "Ajax tooltip" demo. Prototip makes a Ajax request using Prototype's Ajax functions. You just need to build the script that will hand the right content to the request.

Modified example from the Prototip web site:

new Tip('myTip', {
  ajax: {
    url: '/include/ajax.php',  // this is where you put the URL of your script
    options: {
    parameters: { parameter1: value1, parameter2: value2} 
     // this is where you put any parameters to the script
    }
  }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号