-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Php redirect, update hash... #591
Comments
I'm with you on this. It is a quite common practice to redirect to another page after a form submission. At the moment the hash will always adopt the original path and not the redirected one. I might be wrong about this but unfortunately there does not seem to be a way to intercept the redirect status in ajax calls so I'm not sure how easy this would be to implement. It would be nice to have a workaround for this however - maybe a way to explicitly set the hash in the response markup, perhaps something like this:
|
I like the proposed workaround. I'm working on a commit that moves all page-level ID attribute usage over to a new data-url attribute. Maybe once that's implemented, we could make it so if a page arrives with data-url already set in the markup, we use that to set the hash. |
Sounds good - thanks. |
Maybe I found bug in this. When I go from http://example.com/#/action/subaction/1954791 I get this URI http://example.com/#/action/subaction/1954791/anotherAction Is it bug or I use it in bad way? Tested at ae8964f |
I think you're right. The currentimplementation is limited to a url change relative to the page's parent directory, so basically, whatever you pass in data-url will be tacked on to the existing baseURL, allowing you to resolve directory trailing slash issues. We should probably make sure that the data-url attribute replaces the current hash in full though, as you expect. I'll take a look now. |
fixed bug where a preset data-url was being prefixed by the base url, rather than replacing the whole hash. Closed by 2c99787 |
I have tried to implement my own version of supporting redirects by doing the following.
|
… rather than replacing the whole hash. Fixes jquery-archive#591
If the user submits a form to: login.php and the login is sucessfull he must be redirected to home.php
How is it possible to update the hash to home.php ? Or maybe i'm doing something wrong with php, do you expect any particular header to update the hash ?
The text was updated successfully, but these errors were encountered: