weixin_33726943 2015-10-26 19:32 采纳率: 0%
浏览 30

Ajax调用工具提示方法

I have a number of images on my website, with a database with corresponding information. I am at a loss though as to how I should go about generating tooltips for this information.

I thought that using the div ID to do an ajax call to the database would be pretty clean and fairly quick. But I havent really had enough field experience to know if this is the best way to go about it.

I was also thinking that a script could run on page load, populating some elements with the information, which a tooltip would then access. But again, same question, is this the best way to do this?

I would like some possible solutions and why they are better/best with some kind of example code if that is okay.

UPDATE: This is the code I have so far. So now I need an Ajax call to the database to pull the info? How would I go about that? I have looked at the API but I am drawing a blank on implementation. I need a kick in the right direction.

$(document).ready(function(){
  $('.pane').each(function(){
    if( $(this).is(':empty') ) {
    $(this).append( "<p>Test</p>" );
    }
  });
});
  • 写回答

0条回答 默认 最新

    报告相同问题?