Last active
August 29, 2015 14:03
-
-
Save pnghai/b046ec3fce9682b49a2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.getParameterByName = function(name) { | |
| name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
| var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
| var regex = new RegExp(regexS); | |
| var results = regex.exec(window.location.href); | |
| if (results == null) return ""; | |
| else return decodeURIComponent(results[1].replace(/\+/g, " ")); | |
| } | |
| var capitalizeValue = function (value) { | |
| market_source={ | |
| 'google_ads': 'Google Ads', | |
| 'facebook_ads': 'Facebook Ads', | |
| 'gdn': 'GDN', | |
| 'banner':'Banner', | |
| 'hotline':'Hotline', | |
| 'live_chats': 'Live Chats', | |
| 'remarketing':'Remarketing', | |
| 'retargeting':'Retargeting', | |
| 'youtube_ads':'Youtube Ads', | |
| } | |
| if (market_source[value]) | |
| { | |
| return market_source[value]; | |
| } | |
| else {return 'Khác';} | |
| }; | |
| (function(jQuery){ | |
| //$("input.subscription_mk_source").val(window.getParameterByName("utm_source")); | |
| jQuery( document ).ready(function( $ ) { | |
| $("input[name='subscription[mk_source]']").val(capitalizeValue(window.getParameterByName("utm_source"))); | |
| }); | |
| })(window._W && _W.jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment