Prototype AJAX request being sent as OPTIONS rather than GET; results in 501 error

后端 未结 4 1337
情歌与酒
情歌与酒 2020-11-30 09:14

I\'m attempting to access a web service with Prototype/AJAX and am running into an error I can\'t figure out: it seems that when I make a request to a server my request is i

4条回答
  •  醉酒成梦
    2020-11-30 10:04

    I've never used Prototype and i'm not sure how much use i'll be. But I had a quick look at the docs and I didn't see any support for method and parameters.

    So try:

    new Ajax.Request(REQUEST_ADDRESS+"?stationString="+station_id, {
        onSuccess: displayMetar,
        onFailure: function() {
            $("errors").update("an error occurred");
        }
    });
    

    Also I just noticed that stationString in your example should be in quotes assuming it isn't a variable.

提交回复
热议问题