skip to Main Content

Django AJAX call url not found – Jquery ajax

I want to pass data from an AJAX call to my django view. My html: <a href="javascript:" class="word_known btn btn-warning btn-sm" data-songpk="{{song_pk}}" data-userpk="{{user_pk}}">Yes</a> My jquery: $(document).ready(function() { var known_words = 0; $(".word_known").click(function() { known_words++; var reference = this; var songpk…

VIEW QUESTION

Ajax returning `none` in django – Jquery ajax

I Have this form in a table with two button. Code: index.html <form action="{% url 'Prediction' %}" method="post"> {% csrf_token %} <table class="table table-striped table-dark" cellspacing="0"> <thead class="bg-info"> <tr> <th>Company's Symbol</th> <th>Current Price</th> <th>View Current chart</th> <th>Action</th> </tr> </thead> <tbody>…

VIEW QUESTION

Wrong redirection of url in django – Jquery ajax

Updated Question: Wrong redirection of URL in Django. I have this: views.py. def graph(request): if request.method == 'POST' and 'text' in request.POST: print("testing....") print(request.POST.get('text')) name = request.POST.get('text') context = { 'name': name, } print(context) return render(request, 'StockPrediction/chart.html', context) else: return…

VIEW QUESTION
Back To Top
Search