Comments (5)
I found this to be the easiest option
$(document).on('pjax:end', function(event) {
// my code here
}).trigger('pjax:end');
basically triggers the events attached to pjax:end
from jquery-pjax.
Hi there,
You can try using the jQuery Migrate Plugin to add in support for any missing jQuery methods or properties that were removed as jQuery was developed into newer versions.
In my case, I was receiving errors regarding event.props
being undefined.
from jquery-pjax.
@drewminns i aint getting any errors on console i dont think jquery migrate could work in this situation other than the one you pointed out you were facing
from jquery-pjax.
Just dealt with this myself - $(document).on('ready')
was deprecated in jQuery 3.0, and even before that, the handler wouldn't run anyway if the DOM is ready before the event is attached: discussed in the documentation here: https://api.jquery.com/ready/ under the list of ways to attach a function that will run when the DOM is ready. (Deprecation note here: https://jquery.com/upgrade-guide/3.0/#breaking-change-on-quot-ready-quot-fn-removed)
I wound up doing something like this:
handler = function() { ... }
$( handler )
$(document).on('pjax:end', handler)
I went to file a PR to the README here, but realized the ready
event handler has never received any arguments (as shown in the jquery pjax README), so I'm not sure what event.target
in the documentation refers to in the case of the ready
event firing.
from jquery-pjax.
Just dealt with this myself -
$(document).on('ready')
was deprecated in jQuery 3.0, and even before that, the handler wouldn't run anyway if the DOM is ready before the event is attached: discussed in the documentation here: https://api.jquery.com/ready/ under the list of ways to attach a function that will run when the DOM is ready. (Deprecation note here: https://jquery.com/upgrade-guide/3.0/#breaking-change-on-quot-ready-quot-fn-removed)I wound up doing something like this:
handler = function() { ... } $( handler ) $(document).on('pjax:end', handler)
I went to file a PR to the README here, but realized the
ready
event handler has never received any arguments (as shown in the jquery pjax README), so I'm not sure whatevent.target
in the documentation refers to in the case of theready
event firing.
@amywieliczka
Could you explain a little more on this with your fix. I wasn't sure how to implement what your fix
from jquery-pjax.
Related Issues (20)
- Multiple fragment processed
- Document links dump bytes in dom
- the current node list is empty
- PJAX memory Leak issue HOT 1
- Link to do just as browser back button HOT 2
- Prevent form submit with pjax when "enter" is clicked in a form element
- In the JavaScript code, Chinese is converted to unicode.
- How to cancel/abort ongoing request?
- Can't run a container cleanup before the cache snapshot
- When using Pjax, the target page is returned without replace the container
- Modal bootstrap is create class modal-backdrop two times when using pjax
- skeleton loading
- Unusual reaction with pjax (Content is duplciating) HOT 1
- New generation Pjax variations HOT 3
- Pjax switch fail: DOM doesn't look the same on new page
- The css class is missed,when i use PJAX,How to reload it?
- Wrong events lifecycle in case when ajax request is not async
- page reload after append link to hmtl
- 给a标签同时添加多个点击事件不生效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-pjax.