jquery延迟加载外部js实现代码
程序员文章站
2022-03-29 11:26:55
jquery延迟加载外部js实现代码如下:
var gajshost = (("https:" == document.location.protocol)...
jquery延迟加载外部js实现代码如下:
var gajshost = (("https:" == document.location.protocol) ? "https://ssl." : "https://www.");
$.getscript(gajshost + "google-analytics.com/ga.js",function(){
try {
var pagetracker = _gat._gettracker("ua-123456-16");
pagetracker._trackpageview();
} catch(err) {}
});