logo
examples Examples
  • Random machine
  • Multiply example
  • Simple Form
  • Django Forms
  • Map example
  • Flickr in place editor
  • Pagination example

dajaxproject

django+ajax

Random Machine!

Explanation

In this example we will create a random number on the python side of the server, and we will send it to the #result element.

ajax.py

	    import random
		from dajax.core import Dajax
		from dajaxice.decorators import dajaxice_register

		@dajaxice_register
		def randomize(request):
			dajax = Dajax()
			dajax.assign('#result','value',random.randint(1, 10))
			return dajax.json()

	

html

		
		
	
downloads Download   documentation Documentation   bugs Bugs
mail Any issues? Join our mailing list now!
Copyright © 2010 Jorge Bastida | icons by Joseph Wain