Skip to content

Commit 035cbbb

Browse files
thousandsofthemmislav
authored andcommitted
Fix _pjax parameter when data option is explicitly supplied
`data` option for `$.ajax` can be either an Object or Array
1 parent 4d3e868 commit 035cbbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jquery.pjax.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ function pjax(options) {
191191
// Without adding this secret parameter, some browsers will often
192192
// confuse the two.
193193
if (!options.data) options.data = {}
194-
options.data._pjax = context.selector
194+
if ($.isArray(options.data)) {
195+
options.data.push({name: '_pjax', value: context.selector})
196+
} else {
197+
options.data._pjax = context.selector
198+
}
195199

196200
function fire(type, args, props) {
197201
if (!props) props = {}

0 commit comments

Comments
 (0)