You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Query strings are for passing parameters to the server, and have no bearing on the client-side routing available via the hash-tag. To get something working like a "page index" system, which it appears you're trying to do, you can do the following with the latest version of PathJS:
Path.map("#!/rooms/:room_id(/:page)").to(function(){
var page_index = this.params["page"] || 1;
});
The above example uses the new Optional Parameters feature of PathJS. Using this feature, you can access a route like this:
http://www.yoursite.com/#!/rooms/1308513473427 // Access with now page index passed in
http://www.yoursite.com/#!/rooms/1308513473427/2 // Explicitly pass the index in.
In the code example above, you see that I set a default page index if none was passed in.
Any examples available on how to create a path mapping for a url with a query string.
Example URL:
http://localhost:3000/#!/rooms?_=1308513473427&page=2
I'm trying to create a mapping that then returns 2
This does not appear to be taking:
Path.map("#/rooms?:id").to(function(){
});
thanks
The text was updated successfully, but these errors were encountered: