I want to inject a variable like URL into code But it gives an error.
function initializeDataTable (id) {var columnSize = $ ('table th'). Shape (); $ ('# Table'). DataTable ('",' rtFip ',' fnDrawCallback ': function () {$ (' Input: checkbox, input: radio '). Checkbox ();}," bStateSave ": true,' endorsement type ':' Full_number ',' biserside ': true, "sxxsource": "{% url' get_menu_list ''" + id + "'%}"}); }; I have to get the selected option and in the event of changing options, I will call the above work. How can I go about doing this?
You can not do this:
"Sgxsource": " {% Url 'get_menu_list' '"+ + id +"'%} " {%%} are server-side instructions. The server takes action on them and then puts them in the feedback page. The Javascript function runs the client-side. It can not talk to the server and the data can ask for it in the way you expect it to come here. You have to do something that is not dependent on the server, such as: "sAjaxSource": "/ get_menu_list /" + id
Comments
Post a Comment