Commit 328b5b3d by Vasyl Nakvasiuk

use postWithPrefix + $.param

parent 82209850
...@@ -20,12 +20,9 @@ WordCloudMain.prototype = { ...@@ -20,12 +20,9 @@ WordCloudMain.prototype = {
// Send the data to the server as an AJAX request. Attach a callback that will // Send the data to the server as an AJAX request. Attach a callback that will
// be fired on server's response. // be fired on server's response.
ajaxSettings = { $.postWithPrefix(
"data": JSON.stringify(data), _this.ajax_url + '/' + 'submit', $.param(data),
"type": "POST", function (response) {
"contentType": 'application/json; charset=utf-8',
"dataType": 'json',
"success": function (response) {
if ( if (
(response.hasOwnProperty('status') !== true) || (response.hasOwnProperty('status') !== true) ||
(typeof response.status !== 'string') || (typeof response.status !== 'string') ||
...@@ -35,11 +32,6 @@ WordCloudMain.prototype = { ...@@ -35,11 +32,6 @@ WordCloudMain.prototype = {
} }
_this.showWordCloud(response); _this.showWordCloud(response);
} }
};
$.ajaxWithPrefix(
_this.ajax_url + '/' + 'submit',
ajaxSettings
); );
}, // End-of: 'submitAnswer': function (answer, answerEl) { }, // End-of: 'submitAnswer': function (answer, answerEl) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment