Showing
1 changed file
with
18 additions
and
6 deletions
@@ -10,6 +10,23 @@ var $ = require('jquery'), | @@ -10,6 +10,23 @@ var $ = require('jquery'), | ||
10 | 10 | ||
11 | var bannerSwiper; | 11 | var bannerSwiper; |
12 | 12 | ||
13 | +// 获取url中的参数 | ||
14 | +function getUrlParam(name) { | ||
15 | + | ||
16 | + // 构造一个含有目标参数的正则表达式对象 | ||
17 | + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); | ||
18 | + | ||
19 | + // 匹配目标参数 | ||
20 | + var r = window.location.search.substr(1).match(reg); | ||
21 | + | ||
22 | + // 返回参数值 | ||
23 | + if (r != null) { | ||
24 | + return r[2]; | ||
25 | + } | ||
26 | + | ||
27 | + return null; | ||
28 | +} | ||
29 | + | ||
13 | $receive.on('click', function() { | 30 | $receive.on('click', function() { |
14 | var $curDom = $(this); | 31 | var $curDom = $(this); |
15 | 32 | ||
@@ -43,12 +60,7 @@ $receive.on('click', function() { | @@ -43,12 +60,7 @@ $receive.on('click', function() { | ||
43 | } | 60 | } |
44 | }); | 61 | }); |
45 | }); | 62 | }); |
46 | -//获取url中的参数 | ||
47 | -function getUrlParam(name) { | ||
48 | - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 | ||
49 | - var r = window.location.search.substr(1).match(reg); //匹配目标参数 | ||
50 | - if (r != null) return unescape(r[2]); return null; //返回参数值 | ||
51 | -} | 63 | + |
52 | $('.coupon-floor a').on('click', function() { | 64 | $('.coupon-floor a').on('click', function() { |
53 | if ($(this).attr('href').length <= 0) { | 65 | if ($(this).attr('href').length <= 0) { |
54 | return false; | 66 | return false; |
-
Please register or login to post a comment