-
Notifications
You must be signed in to change notification settings - Fork 2.4k
pageload event does not have newly inserted page as a target #3923
Comments
@ucavus - I'm not sure I follow this issue report, seems more like a question. If this is an issue, please include a test page using the latest (template: http://jsbin.com/uqenom/edit), steps to reproduce, platforms, etc. |
According to the docs: " see http://jsbin.com/uqenom/6 with your console open. I think it would have made more sense to have the event fire on the new page's DOM node, since accessing the document and body is trivial but knowing which node was the one that just got inserted is not. It's like jQm says "I just inserted a new node into the DOM, but I'm not telling you which one!" |
@johnbender oe @gseguin - Mind taking a look at this suggestion? |
looks like it's (now?) in the data object that's passed to |
This is indeed part of the data object ( Closing as fixed. |
This was about the DOM node, not the URL. |
Sorry, you are right. When we add the info on this page http://jquerymobile.com/test/docs/api/events.html to the new API docs we have to add the |
Opened a ticket for this at the API documentation repo: jquery/api.jquerymobile.com#96 |
I use
$(document).bind('pageload', ...
, because that event doesn't seem to fire on newly loaded pages' DOM nodes. For event handlers,this
is set to the<body>
. I don't really understand why since<body>
is easily selectable (and there's always good ol'document.body
) so it's not very useful, but only jQm knows for sure which is the newly inserted page node, especially when caching pages. That handler call doesn't have the page node asevent.target
,event.relatedTarget
nor as a property of thedata
argument. It would be really useful to have all the goodness indata
associated with the relevant node.Maybe I'm doing it wrong?
The text was updated successfully, but these errors were encountered: