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

structured parameters not decoded #5

Closed
hawajrambo opened this issue Sep 15, 2013 · 3 comments
Closed

structured parameters not decoded #5

hawajrambo opened this issue Sep 15, 2013 · 3 comments
Assignees

Comments

@hawajrambo
Copy link

var a={q:1, w:"w2", e:{ea:"123qwe", eb:"345asd"}, f:["qw", "er", 12], g:[{zx:123, vv:345}, {zxc:1234, cvb:3455}] };
var u=new Url("https://us:pw@xxx.com/path1/path2?" + decodeURIComponent($.param(a)) );

u.query.e should return {ea:"123qwe", eb:"345asd"}

@Mikhus
Copy link
Owner

Mikhus commented Nov 12, 2013

Thank you for reporting, I'll take a look as I will have free time

@Mikhus
Copy link
Owner

Mikhus commented May 30, 2014

Hi. I'm not sure what you request is something what is SHOULD BE included in jsurl functionality.
Let's see what $.param( a) returns in your case

q=1&w=w2&e[ea]=123qwe&e[eb]=345asd&f[]=qw&f[]=er&f[]=12&g[0][zx]=123&g[0][vv]=345&g[1][zxc]=1234&g[1][cvb]=3455

Jsurl parses it pretty correct:

query: Object
    e[ea]: "123qwe"
    e[eb]: "345asd"
    f[]: Array[3]
        0: "qw"
        1: "er"
        2: "12"
    g[0][vv]: "345"
    g[0][zx]: "123"
    g[1][cvb]: "3455"
    g[1][zxc]: "1234"
    q: "1"

I'm using very common way parsing of query parameters. What you request is a very specific way to do. I fully understand that it is useful, but JSON-like treatment of the var names in query string is a really only one of the special cases which are possible.

Maybe we can adjust some specific name parsers and provide them as separate modules, but it is definitely SHOULD NOT be a core part of jsurl.

@Mikhus Mikhus self-assigned this May 30, 2014
@Mikhus
Copy link
Owner

Mikhus commented Nov 29, 2015

Related: #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants