logo
examples Examples
  • Simple example
  • Simple args example

dajaxproject

django+ajax

Simple dajaxice args example

Explanation

In this example we will send some text to the server and and display it in an alert box.

ajax.py

        from django.utils import simplejson
        from dajaxice.decorators import dajaxice_register

        @dajaxice_register
        def dajaxice_args_example(request, text):
            return simplejson.dumps({'message':'You send %s!' % text})
    

html

    
    
    

javascript

        function my_callback(data){
            alert(data.message);
        }
    
downloads Download   documentation Documentation   bugs Bugs
mail Any issues? Join our mailing list now!
Copyright © 2010 Jorge Bastida | icons by Joseph Wain