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
Add a parsed map of query parameters to dart:html.Location #6679
Comments
Added this to the M3 milestone. |
This comment was originally written by @seaneagan I would vote for just replacing Location with Uri, see issue #2758. |
This comment was originally written by @seaneagan also see issue #2645 |
Good points in issue #2645- seems like following the HttpHeaders model would be appropriate where the result has both: |
Note that there's a whatwg URL spec being worked on with a query map: |
Removed Area-HTML label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Issue #7825 has been merged into this issue. |
Code like this should not have to be reinvented by users:
var map = {};
String query = window.location.search;
if (query.startsWith("?")) { query = query.substring(1); }
for (String param in query.split("&")) {
List<String> kv = param.split("=");
if (kv.length == 1) {
map[kv[0]] = "";
} else if (kv.length == 2) {
map[kv[0]] = uri.decodeUriComponent(kv[1]);
}
}
The text was updated successfully, but these errors were encountered: