-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PathJS Wildcard #63
Comments
You can use |
On 6/7/2013 12:05 PM, Yannick Albert wrote:
Thanks for the reply. I tested what the example does but I can't get it |
Have you read the wiki already? https://github.com/mtrpcic/pathjs/wiki/Using-the-Hashtag#route-parameters |
I know how to use parameters, I have already built numerous apps using pathjs. What I am looking for is to how to execute a function all routes with #/foo. All under the foo route should run the function. |
It is working now with this code Path.map("#/foo/(:x)").to(function() { And the reference link should be https://github.com/mtrpcic/pathjs/wiki/Using-the-Hashtag#optionaldynamic-routes |
Ok, good to know :) Can this issue be closed? |
Issue can be closed now. Thanks for the responses |
@jacobfernandez Were you able to detect any amount of params, like when you said:
|
I want to execute a function if the url matches the defined wildcard structure. For example, I want to run alert("hello world") if the url matches any of these: http://example.com/foo/x, http://example.com/foo/y, http://example.com/foo/z. I don't want to write this code for every route. Is there something like
Path.map("#/foo/*").to(function() {
alert("hello world");
});
?
Thanks
The text was updated successfully, but these errors were encountered: