0

I want to be able to find a way to navigate to a page with parameter in the url for example,

Suppose if I put following like on the browser localhost:8000/?root=profiledetails&id=QQWWES Then I should be able to navigate to page configured with profiledetails in the router and also I should be able to retrieve the query parameter id QQWWES which I need to retrieve data from server.

Can anyone please help me figure this out. Appreciate your help.

1 Answers1

1

You can use the router store and retrieve methods for this.

In your source page store data using store method.

router.store( routerData ); //Router is an instance of router and routerData is 
                            //an object with required data

Then in your target page get the data using retrieve method.

var routerData = router.retrieve();
Rajesh P
  • 343
  • 1
  • 8
  • Well that is like when we have a router object to store. However when I am putting localhost:8000/?root=profiledetails&id=QQWWES url in the browser to open a page and want to retrieve 'QQWWES' in that page from the router instance. How can I do that. – Cool Nebula Aug 01 '17 at 14:09
  • please check the following answer here : https://stackoverflow.com/a/4656873/957654 , at the end you need to use the javascript to get query parameters from the url –  Aug 09 '17 at 12:35