Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

avoid ReferenceError...

  • Loading branch information...
commit eaa74a5f056e412eb1bc88cdeffbb9151a0b5d65 1 parent beeb3f6
@holysugar holysugar authored defunkt committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 jquery.pjax.js
View
9 jquery.pjax.js
@@ -166,6 +166,7 @@ var pjax = $.pjax = function( options ) {
xhr.abort()
}
+ pjax.options = options
pjax.xhr = $.ajax(options)
$(document).trigger('pjax', [pjax.xhr, options])
@@ -184,15 +185,15 @@ pjax.defaults = {
type: 'GET',
dataType: 'html',
beforeSend: function(xhr){
- this.trigger('start.pjax', [xhr, options])
+ this.trigger('start.pjax', [xhr, pjax.options])
xhr.setRequestHeader('X-PJAX', 'true')
},
error: function(xhr, textStatus, errorThrown){
if ( textStatus !== 'abort' )
- window.location = options.url
+ window.location = pjax.options.url
},
- complete: function(){
- this.trigger('end.pjax', [xhr, options])
+ complete: function(xhr){
+ this.trigger('end.pjax', [xhr, pjax.options])
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.