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

support requesting specific set of parameters #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions purl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* JQuery URL Parser plugin, v2.2.1
* JQuery URL Parser plugin, v2.2.1.2
* Developed and maintanined by Mark Perkins, mark@allmarkedup.com
* Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
* Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
Expand Down Expand Up @@ -219,7 +219,27 @@

// return query string parameters
param : function( param ) {
return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
var params = {};
if (typeof param !== 'undefined')
{
if (param instanceof Array)
{
for (var i = 0; i < param.length; i++)
{
var name = param[i];
params[name] = this.data.param.query[name];
}
}
else
{
params = this.data.param.query[param];
}
}
else
{
params = this.data.param.query;
}
return params;
},

// return fragment parameters
Expand Down