def ASSIGNJS(**kargs):
 from gluon.serializers import json
 s = ''
 for (key, value) in kargs.items():
  s += ('var %s = %s;\n' % (key, json(value)))
 return XML(s)

def ASSIGNJS ( ** kargs ) : from gluon . serializers import json s = '' for ( key , value ) in kargs . items ( ) : s += ( 'var %s = %s;\n' % ( key , json ( value ) ) ) return XML ( s )
example: assignjs will return the following javascript variables assignations : var var1 = "1"; var var2 = "2"; args: **kargs: any keywords arguments and assigned values .