Is there a router JS library that can parse a different number of path levels?
-
I'm currently using http://projects.jga.me/routie to parse hash paths. However, it seems difficult to parse different number of levels. E.g. I want to be able to handle both: #/level1/ and also: #/level1/level2/ and even: #/level1/level2/level3/ and so on. Is this possible to achieve using Routie? Or are there other router libraries I may use to achieve that? Or could I make as well make it myself as a simple function implemented in the web app?
-
Answer:
This is probably the easiest way to parse a URI, but `path` is the only thing you get. You can split that by `/` to break it into an array. `var parts = parser.path.split('/');` https://gist.github.com/jlong/2428561
Anthony Ettinger at Quora Visit the source
Related Q & A:
- How To Connect Two Different Network Segments Using A Switch And A Router?Best solution by Super User
- How can I convert a string number to a number in Perl?Best solution by Stack Overflow
- How can I parse a complex XML with PHP and CDATA?Best solution by Stack Overflow
- How can I connect a printer wirelessly to my laptop without a router? Which printer would be the best?Best solution by Yahoo! Answers
- How can I print wirelessly from a laptop to a printer without a router?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.