Hi
Have been trying to implement some AJAX using jQuery.
Have referred to this for some directions
http://kooneiform.wordpress.com/2010/02/28/python-and-ajax-for-beginners-with-webpy-and-jquery/
Basically what I want to do is as a proof of concept is receive some
data from a server and display it on a page.
Server side file simply returns "Ajax Data" when called with POST
code.py
-----------------------------
class tabs:
def POST(self,*args):
return "Ajax Data"
--------------------------------------------------------
Client Side - The code below should receive "Ajax Data" text from
server after clicking #button and display it in sandbox area which is
a div
--------------------------------------------------------
jQuery("#button").click(function() {
$.ajax({
type: 'POST',
data: 'dummy'
success: function(data) {
alert(data); /*Debugging Statement*/
jQuery('#sandbox').html(data);
},
});
return false;
});
However nothing happens. When I added an alert to see what is being
returned. The alert Box displays
[object XMLDocument] while I was expecting a string.
What did I do wrong ?
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.