How can I pass page variable to another?


I’m looking for a way for a page to get the value of the variable passed to it. I read that in V2, the way is to pass it like this:

path: ‘/profile/’,
url: ‘./pages/profile.html’,

var profileView = app.views.create(’#view-profile’, {
url: ‘/profile/’

$$('.open-profile').on('click', function(){

It does open the profile page when you click on a link with the .open-profile class, but I can’t seem to display on the page the variable with the value “john”. I used reinit since the view has already been initialized on start up but it didn’t work:

$$(document).on(‘page:reinit’, ‘.page[data-name=“profile”]’, function (e) {

I also used init but it triggers upon start up and when I the profile page is opened. I need it to trigger only on the profile page.

Basically, I’m looking for the V2 equivalent of V1’s page.query.[variable] and the proper way to do it.

Thanks! :slight_smile:

Please refer this.