我试图执行一个函数并使用参数列表中的连接URL发送一个post请求。
我收到错误:
SyntaxError:missing;在陈述之前
ReferenceError:未定义检查
你可以查看我在这里制作的jsfiddle来测试并看到错误: http://jsfiddle.net/HTg33/
var endpoint = "https://app.someremoterurl.com/api/v1/search/accounts";
var queryParams = {"terms":[{"type":"number_attribute","attribute":"Contract Value","gte":1500},{"type":"string","term":"status_group","in_list":["paying"]},{"type":"date","term":"last_activity_time","joker":"before_last_7_day"}],"count":500000,"offset":0,"fields":[{"type":"date_attribute","attribute":"Create Date","field_display_name":"Create Date"},{"type":"date","term":"last_activity_time","field_display_name":"Last activity"},{"type":"named_aggregation","aggregation":"unique_users","duration":14,"field_display_name":"Active users (14d)"},{"type":"string","term":"status","field_display_name":"Status "},{"type":"string","term":"health","field_display_name":"Health rank "},{"type":"number","term":"contract_value","field_display_name":"Contract value "},{"type":"number","term":"score","field_display_name":"Engagement ","desc":true}],"scope":"all"};
function check() {
alert ('im in');
$.post( endpoint, queryParams)
.done(function( data ) {
alert( "Data Loaded: " + data );
});
}