Skip to content

Commit eaa74a5

Browse files
holysugardefunkt
authored andcommitted
avoid ReferenceError...
1 parent beeb3f6 commit eaa74a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jquery.pjax.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ var pjax = $.pjax = function( options ) {
166166
xhr.abort()
167167
}
168168

169+
pjax.options = options
169170
pjax.xhr = $.ajax(options)
170171
$(document).trigger('pjax', [pjax.xhr, options])
171172

@@ -184,15 +185,15 @@ pjax.defaults = {
184185
type: 'GET',
185186
dataType: 'html',
186187
beforeSend: function(xhr){
187-
this.trigger('start.pjax', [xhr, options])
188+
this.trigger('start.pjax', [xhr, pjax.options])
188189
xhr.setRequestHeader('X-PJAX', 'true')
189190
},
190191
error: function(xhr, textStatus, errorThrown){
191192
if ( textStatus !== 'abort' )
192-
window.location = options.url
193+
window.location = pjax.options.url
193194
},
194-
complete: function(){
195-
this.trigger('end.pjax', [xhr, options])
195+
complete: function(xhr){
196+
this.trigger('end.pjax', [xhr, pjax.options])
196197
}
197198
}
198199

0 commit comments

Comments
 (0)