I'll be publishing a web post on this very subject in the next couple of days. I'll put a link to it on this group when I do.
-- Bruce Eckel www.Reinventing-Business.com www.MindviewInc.com On Wed, Sep 28, 2011 at 11:28 AM, Dexter <[email protected]> wrote: > 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. > > -- 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.
