Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ajax call not being made from qtip
7th September, 14:25
Post: #1
Ajax call not being made from qtip
Hi,

first time I've used qtip and it looks like a terrific plug-in. I am looking to update the content of a hover-over with content from an ajax call, but I am having trouble contacting the server.
I have some images in a grid with their onClick() set to fire the following function that I've pieced together this from the demos -

JS Code
function registerHoverOver() {
$('.ApplyHover').qtip({
            content: {
                text: 'Loading...',
                hide: 'mouseout',
                solo: true,
                ajax: {
                       type: "POST",
                       url: "MyPage.aspx/MyWebMethod",
                       data: "{}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (data) { return data.d }
                      }
            }
        })
}


All I get is the "Loading..." text. I've checked in Firebug and there's no errors in the console, Fiddler doesn't show any traffic off it at all and debugging MyWebMethod doesn't get hit . If I make an Ajax call in a separate function -
JS Code
function registerHoverOver() {
$('.ApplyHover').qtip({
            content: {
                text: 'Loading...',
                hide: 'mouseout',
                solo: true,
                ajax: doAjax()
            }
        })
}
 
function doAjax() {
        $.ajax({
            type: "POST",
            url: "MyPage.aspx/MyWebMethod",
            contentType: "application/json; charset=utf-8",
            data: "{}",
            dataType: "json",
            success: function (data) { var x = data.d  }
        })
    }


then I do get data back the way I would expect it, but I can't get it into my qtip content. Where am I going wrong with this?

Many thanks in advance for any replies.
Find all posts by this user
Quote this message in a reply
7th September, 19:55
Post: #2
RE: Ajax call not being made from qtip
I wouldn't bind qTips on mouseover without setting overwrite to false if I were ,you otherwise ,you'll end up spawning a new qTip for every mouse over, even on the same element. Is there a reason you're not just applying them on document ready?

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Qtip data not find when using ajax pagereload reinier1991 1 74 10th May 07:52
Last Post: reinier1991
  [Solved] qTip Ajax data for text in a div akhil_csit 1 306 14th March 19:27
Last Post: Craig
  [Solved] creating a qtip with ajax contents based on computed uri params punk.kish 1 398 25th January 15:50
Last Post: Craig
  Position of qTip Modal from call within a tooltip chuuke 1 259 17th January 21:54
Last Post: Craig
  ajax call with dataTable lib hanabadler 0 665 23rd September 03:42
Last Post: hanabadler
  [Solved] How to call javascript function within Qtip? When2Meets2 7 1,099 19th September 16:49
Last Post: Craig
  [Solved] How to make qTip work with AJAX and a "enable/disable" checkbox? xzuttz 4 1,041 24th August 19:04
Last Post: Craig
  [Solved] About dynamic cpntent in qTip with AJAX. i.am.not.korr 10 2,015 26th April 03:46
Last Post: i.am.not.korr
  dynamically load clock using ajax in qtip ramzyo5 3 1,497 9th February 16:54
Last Post: Craig
  qTip, AJAX and .NET miketravis 19 5,582 21st January 20:45
Last Post: dotNETMkv



User(s) browsing this thread: 1 Guest(s)