;
(function($) {
$.fn.btnCheckSkip = function(methodName, params) {
var methods = {
"setParameter": function($this, params) {//传递链接参数
var pars = params[1],
url = $this.attr('data-skip') + "?",
len = ""
$.each(pars, function(i) {
url += i + "=" + pars[i] + "&"
})
len = url.length
$this.attr('data-skip', url.substring(0, url.charAt(len - 1) == "&" ? len - 1 : len))
},
'cleanParameter': function($this, params) {//清楚链接参数
var url = $this.attr('data-skip').split("?")
$this.attr('data-skip', url[0])
}
},
args = arguments,
disable = false
return this.each(function() {
var $this = $(this)
if (methods[methodName]) {
methods[methodName]($this, args)
return
}
$this.click(function(event) {
window.location.href = $this.attr('data-skip')
})
})
}
$('[data-skip]').btnCheckSkip()
})(jQuery)
(function($) {
$.fn.btnCheckSkip = function(methodName, params) {
var methods = {
"setParameter": function($this, params) {//传递链接参数
var pars = params[1],
url = $this.attr('data-skip') + "?",
len = ""
$.each(pars, function(i) {
url += i + "=" + pars[i] + "&"
})
len = url.length
$this.attr('data-skip', url.substring(0, url.charAt(len - 1) == "&" ? len - 1 : len))
},
'cleanParameter': function($this, params) {//清楚链接参数
var url = $this.attr('data-skip').split("?")
$this.attr('data-skip', url[0])
}
},
args = arguments,
disable = false
return this.each(function() {
var $this = $(this)
if (methods[methodName]) {
methods[methodName]($this, args)
return
}
$this.click(function(event) {
window.location.href = $this.attr('data-skip')
})
})
}
$('[data-skip]').btnCheckSkip()
})(jQuery)