Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-24-2009, 12:11 PM   PM User | #1
stone28
New to the CF scene

 
Join Date: Dec 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
stone28 is an unknown quantity at this point
[JQuery]Js problem...

Hi,

I am using plugin tooltip from jquery and I have small problem...

How can I return the value of the ajax request? It is comming through I can put is in the alert box or so but not on the level where I need to return that valu to the bodyHandler. Please help.

$(".entry_with_comments").tooltip({
bodyHandler: function() {
var returnValue, movieID;
movieID = $(this).attr("id");

$.ajax({
type: "POST",
url: "testHTML.asp",
data: "movieID="+movieID,
success: function(msg){
returnValue = msg;
//alert(returnValue);
}
});
//$(returnValue).load("testHTML.asp", {'movieID': movieID}, function(){
//alert("asdasdd " + movieID);
return "njij " + returnValue;
}
});

Last edited by Kor; 12-24-2009 at 02:10 PM.. Reason: JQuery prefix added and moved to the Frameworks section
stone28 is offline   Reply With Quote
Old 12-24-2009, 04:25 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
There are dozens of tooltip plugins on the jQuery website; can you be more specific which one you're using? As in, provide a link to the plugin's page on jQuery.com.
__________________
Fumigator is offline   Reply With Quote
Old 01-13-2010, 12:42 PM   PM User | #3
stone28
New to the CF scene

 
Join Date: Dec 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
stone28 is an unknown quantity at this point
Hi,

It's jquery-tooltip plugin..

http://docs.jquery.com/Plugins/Tooltip

So again, what do I have to put in line marked as ### to return result from ajax request:

$(".entry_with_comments").tooltip({
bodyHandler: function() {
var returnValue, movieID;
movieID = $(this).attr("id");
$.ajax({
type: "POST",
url: "testHTML.asp",
data: "movieID="+movieID,
success: function(msg){
returnValue = msg;
}
});
//###what do I have to put here to return "msg" from the ajax request
return returnValue; //unidentified
}
});

Last edited by stone28; 01-13-2010 at 03:48 PM..
stone28 is offline   Reply With Quote
Old 01-13-2010, 04:25 PM   PM User | #4
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
Please wrap your code in appropriate tags. It's much easier to read.

A quick glance at the jquery ajax docs suggests you should do something like this:
Code:
        returnValue = $.ajax({
          /* other stuff */
        }).responseText;
        return returnValue;
__________________
Are you a Help Vampire?
tomws is offline   Reply With Quote
Old 01-13-2010, 05:21 PM   PM User | #5
stone28
New to the CF scene

 
Join Date: Dec 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
stone28 is an unknown quantity at this point
THANK YOU VERY MUCH!!!!!!!

Too be honest just few hours ago I found that myself!!! But it's great to see that somebody is here with help ;-)

Thanks for your time.
stone28 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:18 PM.


Advertisement
Log in to turn off these ads.