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

parseUrlQuery can't use after the version update #1248

Closed
1 of 3 tasks
hwygy001 opened this issue Dec 19, 2016 · 3 comments
Closed
1 of 3 tasks

parseUrlQuery can't use after the version update #1248

hwygy001 opened this issue Dec 19, 2016 · 3 comments

Comments

@hwygy001
Copy link

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion

  • Framework7 Version: version 1.5

Issue

After i update the new version framework7, i can't get my param when i set pushstate true.
such url 'http://127.0.0.1:8080/#/views/car-choice.html?loaddingMore=0' will only get the {}.
and i find it caused by a merge 76d768c .

hwygy001 pushed a commit to hwygy001/Framework7 that referenced this issue Dec 19, 2016
@hwygy001
Copy link
Author

hwygy001 commented Dec 20, 2016

$.parseUrlQuery= function (searchStr, name) {
    var qObj = {};
    var searchStr = searchStr || location.href;
    searchStr = searchStr.indexOf('?')>-1 ? searchStr.replace(/\S*\?/,'') : '';
    if (searchStr) {
        var params = searchStr.split('&'),
            length = params.length, a;

        for (var i = 0; i < length; i++) {
            a = params[i].replace(/#\S+/g,'').split('=');
            qObj[decodeURIComponent(a[0])] = decodeURIComponent(a[1] || '');
        }
    }
    return name ? qObj[name] : qObj;
}

@nolimits4web
Copy link
Member

Because in this case your query is part of the location hash not of the query. You can use $$.parseUrlQuery('http://127.0.0.1:8080/#/views/car-choice.html?loaddingMore=0'.split('#')[1]) in such case

hwygy001 pushed a commit to hwygy001/Framework7 that referenced this issue Jan 5, 2017
…ke it work more place

modify code more similar with origin
@ZanderBrown ZanderBrown added this to Resolved in Bug Report Triage Jan 28, 2018
@lock
Copy link

lock bot commented Jun 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Jun 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Bug Report Triage
  
Resolved
Development

No branches or pull requests

2 participants