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

Handle + sign in URL query string parameters #181

Open
wieloch opened this issue Aug 11, 2021 · 1 comment
Open

Handle + sign in URL query string parameters #181

wieloch opened this issue Aug 11, 2021 · 1 comment

Comments

@wieloch
Copy link

wieloch commented Aug 11, 2021

https://github.com/adlnet/xAPIWrapper/blob/master/src/xapiwrapper.js

`// parses the params in the url query string
function parseQueryString()
{
var qs, pairs, pair, ii, parsed;

    qs = window.location.search.substr(1);

    pairs = qs.split('&');
    parsed = {};
    for ( ii = 0; ii < pairs.length; ii++) {
        pair = pairs[ii].split('=');
        if (pair.length === 2 && pair[0]) {
            parsed[pair[0]] = decodeURIComponent(pair[1]).replace(/\+/g, " ");
        }
    }
    return parsed;
}`
@wieloch
Copy link
Author

wieloch commented Aug 11, 2021

This is a common issue, just google decodeURIComponent and plus sign

https://stackoverflow.com/questions/31670413/plus-sign-in-encoded-url

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

No branches or pull requests

1 participant