Skip to content

Instantly share code, notes, and snippets.

@dfang
Created September 25, 2012 10:33
Show Gist options
  • Select an option

  • Save dfang/3781096 to your computer and use it in GitHub Desktop.

Select an option

Save dfang/3781096 to your computer and use it in GitHub Desktop.
get url params
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
@dfang

dfang commented Sep 25, 2012

Copy link
Copy Markdown
Author

jQuery 判断空对象的方法
isEmptyObject
var obj = { };
var arr = [];

$.isEmptyObject(obj); => true
$.isEmptyObject(arr); => true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment