开发者

Internet Explorer causes an Invalid Authenticity Token error

This works in all browsers except IE7 and IE8 ( and probably IE6 ).

For some reason it won't respect my Authenticity Token.

Any ideas, tips for debugging, workaroun开发者_运维知识库ds?

My standard setup:

$(document).ajaxSend(function(event, request, settings) {
    if ( settings.type != 'GET' ) {
        settings.data = (settings.data ? settings.data + "&" : "")
            + "authenticity_token=" + encodeURIComponent( AUTH_TOKEN );
    }
});

My AJAX call:

$(".ajax-referral").click(function(){
  $.ajax({
      type: "POST", 
      url: $(this).parent("form").attr("action"), 
      data:$(this).parent("form").serialize(),
      dataType: "script",
      });
  return false;
});


This error was caused by using IETester in Parallels through Mac OSX. IETester does not hold Authenticity Tokens in its sessions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜