sanmai sanmai - 8 months ago 168
jQuery Question

AJAX content in a jQuery UI Tooltip Widget

There is a new Tooltip Widget in jQuery UI 1.9, whose API docs hint that AJAX content can be displayed in it, but without any further details. I guess I can accomplish something like that with a synchronous and blocking request, but this isn't what I want.

How do I make it display any content that was retrieved with an asynchronous AJAX request?


Here is a ajax example of jqueryui tootip widget from my blog.hope it helps.

    position: { my: "left+15 top", at: "right center" },
    content:function(callback) {
        $.get('preview.php', {
        }, function(data) {
            callback(data); //**call the callback function to return the value**