xoxco/jQuery-Tags-Input — pull request #125 by realityendshere (2013-05-23 22:18:40+00:00)
Title: Fixed incorrectly declared variables, code style adjustments, passes JSHINT

Several variables were declared without `var` causing them to spill into the global namespace.

For example (existing line 171):

```
$.fn.importTags = function(str) {
id = $(this).attr('id'); //no var declaration!!
$('#'+id+'_tagsinput .tag').remove();
$.fn.tagsInput.importTags(this,str);
}
```

is now

```
$.fn.importTags = function(str) {
var id = $(this).attr('id');
$('#' + id + '_tagsinput .tag').remove();
$.fn.tagsInput.importTags(this,str);
};
```

Variables declared without `var` end up in the global namespace and can quickly lead to difficult to debug, unintended side-effects. (In my case, the plugin corrupted unrelated data!)

Additionally, I adjusted the code to be compliant with JSHINT with the following configuration:

```
"latedef" : 1,
"newcap" : 1,
"curly" : 1,
"trailing" : 1,
"nonew" : 1,
"withstmt" : 0,
"yui" : 0,
"mootools" : 0,
"proto" : 0,
"boss" : 0,
"funcscope" : 0,
"regexdash" : 0,
"jquery" : 1,
"esnext" : 0,
"camelcase" : 0,
"es5" : 0,
"dojo" : 0,
"strict" : 0,
"devel" : 0,
"onecase" : 0,
"wsh" : 0,
"nonstandard" : 0,
"asi" : 0,
"smarttabs" : 0,
"rhino" : 0,
"noempty" : 0,
"lastsemic" : 0,
"eqnull" : 0,
"eqeqeq" : 1,
"couch" : 0,
"evil" : 0,
"expr" : 0,
"immed" : 0,
"globalstrict" : 0,
"undef" : 1,
"iterator" : 0,
"prototypejs" : 0,
"noarg" : 1,
"supernew" : 0,
"node" : 0,
"unused" : 1,
"debug" : 0,
"bitwise" : 1,
"white" : 0,
"browser" : 1,
"worker" : 0,
"laxcomma" : 0,
"multistr" : 0,
"shadow" : 0,
"sub" : 0,
"regexp" : 1,
"scripturl" : 0,
"forin" : 0,
"loopfunc" : 0,
"laxbreak" : 0,
"plusplus" : 0
```

Lastly, I replaced `escape` and `unescape` functions with `encodeURI` and `decodeURI`. `escape` and `unescape` are deprecated functions and may not work as expected (according to MDN documentation)