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

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -