Last active
December 22, 2015 15:38
-
-
Save firedfox/6493256 to your computer and use it in GitHub Desktop.
This file contains 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
const AD_ID:String = 'bab76d78ff916132c83833ae30776fb7'; | |
var isMktSent:Boolean = isMktSent; | |
if (ExternalInterface.available && !isMktSent && (isMktSent = true)) { | |
ExternalInterface.addCallback('getMktAdId', function():String { return AD_ID; }); | |
ExternalInterface.call(['eval(\'(function() {', | |
'var o = document.getElementsByTagName("*");', | |
'for (var i in o) {', | |
'if (o[i].getMktAdId && o[i].getMktAdId() == "' + AD_ID + '") {', | |
'var hook = document.createElement("div"); hook.id = "_bdhm_mkt_' + AD_ID + '";', | |
'if (o[i].nextSibling) { o[i].parentNode.insertBefore(hook, o.nextSibling); }', | |
'else { o[i].parentNode.appendChild(hook); }', | |
'}', | |
'}', | |
'var mkt = document.createElement("script"); mkt.src = "//click.hm.baidu.com/mkt.js?' + AD_ID + '";', | |
'var h = document.getElementsByTagName("head"); h && h[0].appendChild(mkt);', | |
'})();\')'].join('')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment