I want to parse an iframe URL using FlowRouter.getQueryparams() instead of using window.location.href.split(). I have tried looking into documents, but all it talks about is passing parameters and in-app routing. Is there a way to pass URL like : http://localhost:3000/?id="Awx34R56YUND"&userId="QP90pr5f" to Flowrouter and get the parameters like FlowRouter.getQueryparams('id') and FlowRouter.getQueryparams('userId')?
Add a comment
|
1 Answer
Yes you can get query parameters in a URL, see this example below
// route def: /apps/:appId
// url: /apps/this-is-my-app?show=yes&color=red
var color = FlowRouter.getQueryParam("color");
console.log(color); // prints "red"
source: Documentation
2 Comments
Bhimesh Chauhan
Yeah, I tried that. It always returns me undefined.
electrode
try this localhost:3000/?id=Awx34R56YUND&userId=QP90pr5f, I noticed you included them in quotes