js截取路径参数
(function ($) {
$.getUrlParam = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
};
})(jQuery);
var userId = $.getUrlParam('userId');
//设备上物理像素和设备独立像素(device-independent pixels (dips))的比例
var device = window.devicePixelRatio;
相关文章:http://www.zhangxinxu.com/wordpress/?p=2568