Skip to content

parseQueryString is not working properly if hashes appear after the search #74

@webb-nickj

Description

@webb-nickj

The parseQueryString method in xAPIWrapper takes no account of hashes potentially appearing after the search paramters.

Something like this would overcome the problem:

function parseQueryString()
{
    var loc, 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]);
        }
    }
    return parsed;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions