Parse query string - Node.js Network

Node.js examples for Network:URL

Description

Parse query string

Demo Code

parseQuery: function() {
    var result = {};
    window.location.search.toString().replace(/(?:\?|&)([^&=]*)=?([^&]*)/g, function($0, $1, $2) {
        if ($1) {
            result[$1] = $2 || true;//w w w .  j  ava2 s .  c o m
        }
    });
    return result;
},

Related Tutorials