javascript - how to assign the ajax return data to my variable? -
i trying unable set return data of ajax call variable $variable. remember working in js file
var variable = {} $(document).ready(function () { jquery.ajax({ type: 'post', url: baseurl + 'port/skills', context: document.body, error: function (data, transport) { alert("sorry, operation failed."); }, success: function (data) { //var countries=data; $("variable").val(data); } }); });
use variable = data;
instead of $("variable").val(data);
Comments
Post a Comment