编写 parse.cloud 代码来读取跨域 xml。我曾尝试使用 jquery-ajax,但遇到语法问题,我的代码是
Parse.Cloud.define("read", function(request, response) {
var query = 'http://data.gov.in/sites/default/files/Date-Wise-Prices-all-Commodity.xml&callback=?';
$.ajax({
url: query,
type: 'GET',
dataType: 'json',
success: function(s) {
response.success("Success");
},
error: function(e)
{
response.success("Error "+e)
}
});
});
我收到以下错误:
"code":141,"error":"ReferenceError: $ is not defined\n at main.js:5:20