Run function after router.navigate

Hello,

I would like to run a function after router.navigate is complete. How can this be done?

I use the following code:
app.router.navigate(’/’ + page + ‘/’ + “?z=” + token + “&time=” + seconds + query)

Thank you for your time

Help anyone? Or has this forum become a payed only answers?

You may take a look on pageinit

Ps: no one is paid here

1 Like

I thought that there might be an inbuilt procedure that ran when router.navigate has completed. I was trying to avoid placing a pagenit on every page.

I guess I will have to go with that solution. Thank you for your time.

you can have a page:init called for every page as below:

$$( document).on( 'page:init', function( e, page) {

}),
1 Like

Works great! Thank you very much!

SOLVED

No problem, we are here to help each other, it’s a great framework thanks to @nolimits4web

2 Likes