1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /*
- 广告使用区域
- */
- Namespace.register("U.UF.DL.C.AD"); //桌面广告命名空间
- //#region 百度广告
- /*
- * 百度异步加载
- *
- * @param {string} 广告id
- */
- U.UF.DL.C.AD.onloadBaiduJs = function (baiduid) {
- U.UF.DL.asynLoadJs({ "src": "//hm.baidu.com/hm.js?" + baiduid }); //加载广告
- }
- /*
- * 百度异步加载
- *
- * @param {string} 广告位置id
- * @param {string} 广告id
- */
- U.UF.DL.C.AD.baidu = function (elementid, baiduid) {
- if (baiduid) { //异步加载
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "http://cbjs.baidu.com/js/m.js" },
- function () {
- U.UF.DL.C.AD.asynBaidu(elementid, baiduid);
- }); //异步加载
- }
- }
- /*
- * 异步广告
- *
- * @param {string} 广告位置id
- * @param {string} 广告id
- */
- U.UF.DL.C.AD.asynBaidu = function (elementid, code) {
- BAIDU_CLB_fillSlotAsync(code, elementid);
- }
- //#endregion
- //#region
- /*
- * 异步阿里妈妈广告
- *
- * @param {string} 广告位置id
- */
- U.UF.DL.C.AD.alimama = function (obj) {
- //阿里巴巴官网实例
- var i,
- _aliobj = window.alimamatk_onload = window.alimamatk_onload || [];
- if (Array.isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- U.UF.DL.C.AD.alimama(obj[i]);
- }
- }
- else {
- _aliobj.push(U.UF.C.isObject(obj) ? obj : (obj = { pid: obj, appkey: "", unid: "", type: "click" }));
- } //加载广告
- if (!window.alimamatk_show) {
- U.UF.DL.asynLoadJs({ type: "text/javascript", id: obj.pid, charset: "gbk", async: true, src: "http://a.alimama.cn/tkapi.js" });
- }
- }
- /*
- * 阿里妈妈广告异步
- *
- * @param {string} 广告位置id
- */
- U.UF.DL.C.AD.asynAlimama = function (el, id) {
- $$("a", { style: { "display": "none!important" }, id: "tanx-a-" + id }, el); //显示元素
- U.UF.DL.asynLoadJs({ type: "text/javascript", id: "tanx-s-" + id, async: true,
- charset: "gbk", async: true, src: "http://p.tanx.com/ex?i=" + id
- }); //加载广告
- }
- //#endregion
|