Skip to content

Category: Questions

Using innerHTML to include HTML Django page not work

I am trying to include an HTML when a button is clicked in a Django project but the error a Uncaught SyntaxError: Invalid or unexpected token Here is the Javascript: The error showing is at this line of code as if the include code is not there at all. My question: How can I add this code through javascript an…

how to pass $(this).data() in ajax request

i need to pass $(this).data into success func in ajax. here is my code But $(this).addClass(‘wishlist-comp-saved’); is not working inside success: function(data) {} Answer $(this) will change context when called. When inside of the success: function (data), $(this) is not the same as it was inside…