Function pointers in javascript using django

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-05-11T14:01:17Z Indexed on 2010/05/11 14:04 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

Is this a valid function pointer code below,

In views ,

    def change(request):
       dict={}
       function_ptr="create()" 

        dict.update({'function_ptr' : function_ptr})
       return render_to_response('mpjt/create.html',context_instance=RequestContext(request,{'dict': dict}))

In create.html

      $(document).ready(function() {
     var a = '{{dict.function_ptr}}'

     func_ptr(a);

      function create()
     {
       alert('got respponse');
      }
     });

Thanks..

© Stack Overflow or respective owner

Related posts about django

Related posts about django-views