$("#yes-link").click(function () {
$.ajax({
type: "POST",
url: "http://0.0.0.0:3001/api/helpful/",
data: {url: "sad", value: "yes"},
dataType: "jsonp",
success: function(data) { alert(data); }
});
});
由于某种原因,服务器总是看到GET。
Started GET "/api/helpful/?callback=jQuery11110520667711738497_1405634368646&url=sad&value=yes&_=1405634368649" for 127.0.0.1 at 2014-07-17 18:01:30 -0400
Processing by Api::HelpfulController#get as JSON
Parameters: {
"callback" = > "jQuery11110520667711738497_1405634368646",
"url" = > "sad",
"value" = > "yes",
"_" = > "1405634368649"
}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."ip" = '127.0.0.1' LIMIT 1
Helpful Load (0.1ms) SELECT "helpfuls".* FROM "helpfuls" WHERE "helpfuls"."user_id" = 1 AND "helpfuls"."url" = 'sad' LIMIT 1
Completed 200 OK in 2ms (Views: 0.1ms | ActiveRecord: 0.3ms
此外,参数列表中的"_"=>"1405634368649"
是什么?