Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: jquery.unobtrusive-ajax.js forget $.ajax global options [1525]

$
0
0
Copied from https://aspnet.codeplex.com/workitem/8186
Vote number: 5

The global default value (set with jQuery.ajaxSetup) for "type" is overriden with "GET" in $("form[data-ajax=true]").live("submit"
and in $("a[data-ajax=true]").live("click"

Also:
X-HTTP-Method-Override/X-Requested-With are added in options.data instead of option.headers

In $("a[data-ajax=true]").live("click" the type is forced to GET and data reset to an empty array [], ignoring global options.
Comments: * jQuery.ajaxSetup is meant to provide default values for jQuery's XHR requests. By specifying a request type or an empty data in unobtrusive-ajax.js, we're not violating the contract for ajaxSetup. One approach to fixing your issue would be to create custom AjaxHelper options which sets the HttpMethod to "POST" by default. * Sending the X-Requested-With and X-HTTP-Method-Override headers as a data (query) parameter is a design choice meant to work around incorrectly configured proxies that might strip off non standard headers. * We've fixed the "this" issue as part of https://aspnetwebstack.codeplex.com/workitem/1487

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>