Javascript syntax error in Django Template when variable value is missing

前端 未结 1 685
失恋的感觉
失恋的感觉 2021-01-24 09:32

I have a Django template with an AJAX menu (where clicking on different menu items reloads a part of the page). Each menu click invokes a Django view function through AJAX and r

相关标签:
1条回答
  • 2021-01-24 10:23

    As discussed, you should use JSON to send the data from Python to JS; use JSON.parse() to deserialize the data for use in your JS.

    0 讨论(0)
提交回复
热议问题