JavaScriptã®ãã¹ãã©ã¤ãã©ãªJasmineã§ãã¹ããæ¸ãã¦ãã¦åµã£ãã®ã§ã¡ã¢ ãã¹ããããã³ã¼ãã¯ãããªæã function Details() { this.id = 0; this.name = ""; } Details.prototype.getData = function (url, id) { var self = this; $.ajax({ url: url, type: "GET", datatype: "json", data: { id: id }, }).done(function (data) { self.id = data.Id; self.name = data.Name; }).fail(function (message) { alert(message); }); }; ã¾ããããªæãã®ããããjQueryã使ã£ãAjaxã§ãã¼ã¿ãåå¾ã
{{#tags}}- {{label}}
{{/tags}}