onSwitch is undefined - "this" is "window", not "pjax" #51

Closed
opened 2016-01-04 20:55:39 -05:00 by darylteo · 5 comments
darylteo commented 2016-01-04 20:55:39 -05:00 (Migrated from github.com)
Pjax switch fail:  
TypeError: this.onSwitch is not a function(…)(anonymous function) @ vendor.bundle.js:277 

Stack Trace

module.exports.outerHTML (vendor.bundle.j…v=20160105:740)
(anonymous function) (vendor.bundle.j…v=20160105:722)
module.exports (vendor.bundle.j…v=20160105:390)
(anonymous function) (vendor.bundle.j…v=20160105:713)
module.exports (vendor.bundle.j…v=20160105:697)
Pjax.switchSelectors (vendor.bundle.j…v=20160105:174)
Pjax.loadContent (vendor.bundle.j…v=20160105:225)
(anonymous function) (vendor.bundle.j…v=20160105:272)
request.onreadystatechange (vendor.bundle.j…v=20160105:860)

Happens in switches.js outerHTML and innerHTML

``` Pjax switch fail: TypeError: this.onSwitch is not a function(…)(anonymous function) @ vendor.bundle.js:277 ``` Stack Trace ``` module.exports.outerHTML (vendor.bundle.j…v=20160105:740) (anonymous function) (vendor.bundle.j…v=20160105:722) module.exports (vendor.bundle.j…v=20160105:390) (anonymous function) (vendor.bundle.j…v=20160105:713) module.exports (vendor.bundle.j…v=20160105:697) Pjax.switchSelectors (vendor.bundle.j…v=20160105:174) Pjax.loadContent (vendor.bundle.j…v=20160105:225) (anonymous function) (vendor.bundle.j…v=20160105:272) request.onreadystatechange (vendor.bundle.j…v=20160105:860) ``` Happens in switches.js outerHTML and innerHTML
darylteo commented 2016-01-04 22:28:16 -05:00 (Migrated from github.com)

Now it's

"TypeError: Pjax.forEachEls is not a function
    at vendor.bundle.js?v=20160105:239:13
    at Array.forEach (native)
    at Object.Pjax.loadContent (vendor.bundle.js?v=20160105:238:29)
    at Object.<anonymous> (vendor.bundle.js?v=20160105:272:15)
    at XMLHttpRequest.request.onreadystatechange (vendor.bundle.js?v=20160105:872:10)"
Now it's ``` "TypeError: Pjax.forEachEls is not a function at vendor.bundle.js?v=20160105:239:13 at Array.forEach (native) at Object.Pjax.loadContent (vendor.bundle.js?v=20160105:238:29) at Object.<anonymous> (vendor.bundle.js?v=20160105:272:15) at XMLHttpRequest.request.onreadystatechange (vendor.bundle.js?v=20160105:872:10)" ```
darylteo commented 2016-01-04 23:00:29 -05:00 (Migrated from github.com)

And now it's

"TypeError: Pjax.executeScripts is not a function
    at vendor.bundle.js?v=20160105:242:15
    at NodeList.forEach (native)
    at module.exports (vendor.bundle.js?v=20160105:392:37)
    at vendor.bundle.js?v=20160105:241:8
    at Array.forEach (native)
    at Object.Pjax.loadContent (vendor.bundle.js?v=20160105:240:29)
    at Object.<anonymous> (vendor.bundle.js?v=20160105:274:15)
    at XMLHttpRequest.request.onreadystatechange (vendor.bundle.js?v=20160105:874:10)"

Sorry for the spam, just recording these as I go along.

And now it's ``` "TypeError: Pjax.executeScripts is not a function at vendor.bundle.js?v=20160105:242:15 at NodeList.forEach (native) at module.exports (vendor.bundle.js?v=20160105:392:37) at vendor.bundle.js?v=20160105:241:8 at Array.forEach (native) at Object.Pjax.loadContent (vendor.bundle.js?v=20160105:240:29) at Object.<anonymous> (vendor.bundle.js?v=20160105:274:15) at XMLHttpRequest.request.onreadystatechange (vendor.bundle.js?v=20160105:874:10)" ``` Sorry for the spam, just recording these as I go along.
darylteo commented 2016-01-04 23:04:39 -05:00 (Migrated from github.com)

Also clone.

Also clone.
MoOx commented 2016-01-05 01:16:36 -05:00 (Migrated from github.com)

Closed by c12e4cdedd ?

Closed by c12e4cdeddf48b9aec451aa745bed8d5fbb7c129 ?
darylteo commented 2016-01-05 01:18:15 -05:00 (Migrated from github.com)

Yes that commit should fix the errors.

I have a parched 0.2.1 working on my app right now (bugs notwithstanding)

Daryl
On Tue, Jan 5, 2016 at 5:16 PM Maxime Thirouin notifications@github.com
wrote:

Closed #51 https://github.com/MoOx/pjax/issues/51.


Reply to this email directly or view it on GitHub
https://github.com/MoOx/pjax/issues/51#event-505575223.

Yes that commit should fix the errors. I have a parched 0.2.1 working on my app right now (bugs notwithstanding) Daryl On Tue, Jan 5, 2016 at 5:16 PM Maxime Thirouin notifications@github.com wrote: > Closed #51 https://github.com/MoOx/pjax/issues/51. > > — > Reply to this email directly or view it on GitHub > https://github.com/MoOx/pjax/issues/51#event-505575223.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#51