Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

Crash in .get() if querystring doesn't contain the item


Project:Query String Object
Version:1.2
Component:Code
Category:bug report
Priority:critical
Assigned:blair
Status:closed
Description

I'm getting a crash when I request a value that doesn't exist in the querystring: see http://xidey.wordpress.com/2008/02/16/bug-in-jquery-query-plugin-version...

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#1

Just replace
get: function(key) {
var value = (key == undefined) ? this.keys : this.keys[key];
if (value.constructor == Array)
return value.slice(0);
else if (value.constructor == Object)
return jQuery.extend({}, value);
else
return value;
},

with:
get: function(key) {
var value = (key == undefined) ? this.keys : this.keys[key];
if(!this.keys[key]) return '';
if (value.constructor == Array)
return value.slice(0);
else if (value.constructor == Object)
return jQuery.extend({}, value);
else
return value;
},

It will now return an empty string if there is no value

#2

Priority:normal» critical
Assigned to:Anonymous» blair
Status:active» fixed

This is fixed in version 1.2.1

#3

Status:fixed» closed

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.