打印

[求教]Ajax请求Action出现在异常.

[求教]Ajax请求Action出现在异常.



new Ajax.Request('/hello',
         {
            method : 'post',
            parameters :
            {
               text : old_text
            }
            ,
            asynchronous : true,
            onSuccess : function(transport)
            {
                alert(transport.responseText);
               this.setValue(transport.responseText);
               $('php?name=editor" onclick="tagshow(event)" class="t_tag">editor_switch_spinner').hide();
            }
            .bind(this)
         }
         );


上面一段代码,如果将Post改成Get,则没有任何问题,但是可能请求的内容很多,所以用Get方式不是很合适.
但用Post时,则会报如下异常:
ActionController::InvalidAuthenticityToken in HelloController#hello
ActionController::InvalidAuthenticityToken

求解答!

TOP

2008-11-22 19:55 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html) @38.103.63.61