', { btn: ["继续访问", "取消"], title: false, shade: 0.7, area: [w, h], cancel: function(index) { o.attr("href", href); }, }, function() { o.attr("href", href); o.attr("target", "_blank"); o.data("ask", "1"); layer.close(cf); o[0].click(); }, function() { o.attr("href", href); } ); } }); //截取URL域名部份 var getHost = function(url) { var host = "null"; if (typeof url == "undefined" || null == url) url = window.location.href; var regex = /.*\:\/\/([^\/]*).*/; var match = url.match(regex); if (typeof match != "undefined" && null != match) host = match[1]; return host; };