skip to Main Content

How pass the variable from template to view? – Jquery ajax

template.html <input type="text" id="text"> <input id="submit" name="submit" type="submit"> <div id="roro"></div> <script type="text/javascript"> $('#submit').click(function(){ $.ajax({ url:'', data : {'text':$('#submit').val()}, type: 'POST', dataType : 'json', success:function(data){ $('#roro').text(result['data']); }, error:function(r){ alert(text); } }); }); </script> view.py @csrf_exempt def construction(request): if request.method == 'POST':…

VIEW QUESTION
Back To Top
Search