If you set up a dynamic fixture with a templated URL, the originalOptions param of the callback will not be updated with the templated URL values if the data prop was not set in options of the AJAX call.
The solution I devised involves checking to make sure the data property of originalOptions exists and if it doesn't, setting it to an empty object before calling jQuery.extend.
@@ -53,6 +53,10 @@
settings.dataTypes.splice(0,0,"fixture");
if(data){
+ if(! ('data' in originalOptions)) {
+ originalOptions.data = {};
+ }
+
$.extend(originalOptions.data, data)
}
// add to settings data from fixture ...
If you set up a dynamic fixture with a templated URL, the originalOptions param of the callback will not be updated with the templated URL values if the
data
prop was not set in options of the AJAX call.I suspect the problem is that here https://github.com/jupiterjs/jquerymx/blob/master/dom/fixture/fixture.js#L62, if you try to merge an object into
undefined
withjQuery.extend
, it fails. So if$.extend(originalOptions.data, data)
equates to$.extend(undefined, { id: '10' })
, thendata
isn't created.The solution I devised involves checking to make sure the
data
property oforiginalOptions
exists and if it doesn't, setting it to an empty object before callingjQuery.extend
.