You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ...
The text was updated successfully, but these errors were encountered:
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
.The text was updated successfully, but these errors were encountered: