Skip to content
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

Closed
justinfagnani opened this issue Nov 12, 2012 · 12 comments
Closed

Add a parsed map of query parameters to dart:html.Location #6679

justinfagnani opened this issue Nov 12, 2012 · 12 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@justinfagnani
Copy link
Contributor

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]);
    }
  }

@blois
Copy link
Contributor

blois commented Dec 6, 2012

Added this to the M3 milestone.

@blois
Copy link
Contributor

blois commented Jan 30, 2013

Set owner to @blois.
Added Accepted label.

@DartBot
Copy link

DartBot commented Jan 30, 2013

This comment was originally written by @seaneagan


I would vote for just replacing Location with Uri, see issue #2758.

@DartBot
Copy link

DartBot commented Jan 30, 2013

This comment was originally written by @seaneagan


also see issue #2645

@blois
Copy link
Contributor

blois commented Jan 30, 2013

Good points in issue #2645- seems like following the HttpHeaders model would be appropriate where the result has both:
  List<String> operator[](String name);
  String value(String name);

@justinfagnani
Copy link
Contributor Author

Marked this as being blocked by #2645, #2758.

@blois
Copy link
Contributor

blois commented Feb 8, 2013

Removed this from the M3 milestone.
Added this to the Later milestone.

@blois
Copy link
Contributor

blois commented Apr 11, 2013

Note that there's a whatwg URL spec being worked on with a query map:
http://url.spec.whatwg.org/#api

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@alan-knight
Copy link
Contributor

Issue #7825 has been merged into this issue.

@justinfagnani justinfagnani added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html labels Jan 14, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed accepted labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants