jaunesarmiento / fries

Fries helps you prototype Android apps using HTML, CSS, and JavaScript.
MIT License
1.55k stars 222 forks source link

Passing parameters to another page with stack.js and executing code on page load #30

Closed aymanfarhat closed 11 years ago

aymanfarhat commented 11 years ago

Hello I am looking into using/extending stack.js page to be used as a detail view for an app. For example I have a page called profile.html which is opened from my index via stack.js.

What I'd like to do is open profile.html with a parameter such as profile.html?id=1 and when profile.html loads execute a callback to query a remote database and populate some DOM elements in profile.html

Is there a certain pattern which can be followed for now in order to achieve such a thing? I think this feature can be a great use for future releases.

jaunesarmiento commented 11 years ago

Hi @aymanfarhat, as of now there is no such pattern to achieve this. You can however save these parameters in a global variable, catch the push event that stack.js fires, and then using the parameters from there. This may not be the best solution to this.

I'm open to suggestions on how to implement this or if we even should implement it at all. I also think this could be a great addition to Fries since I'm not just aiming to make Fries a prototyping tool.

jaunesarmiento commented 11 years ago

I believe this is related to #26.