js 常用indexof url,域名,浏览类型 获取函数
*/
function pv_rport(dm,f) {
var i = dm.indexof(f);
if (i > 0) {
return dm.substring(0, i);
}
return dm;
}function getrefurl(refurl) {
if (refurl.indexof('ref0') > -1){
var regexstr = /(?:&|?)ref0=([ss]*?)$/i;
refurl = refurl.match(regexstr);
refurl = encodeuri(refurl[1]);
return refurl;
}
}
function getdomain(){
var dm = '';
hn=location.hostname;
str=hn.replace(/.(com|net|org|cn$).?.*/,"");
if(str.lastindexof(".") == -1)
dm = "." + hn;
else
{
str = str.substring(str.lastindexof("."));
dm = hn.substring(hn.lastindexof(str));
}
return dm;
}function getflash(){
var i,flash;
if (window.activexobject){
for(i=12;i>0;i--){
try{
flash=new activexobject("shockwaveflash.shockwaveflash."+i);
return i+".0";
}
catch(e){
}
}
}
else if (navigator.plugins&&navigator.plugins.length){
for (i=0;i<navigator.plugins.length;i++){
if (navigator.plugins[i].name.indexof('shockwave flash')!=-1){
return navigator.plugins[i].description.split(" ")[2];
}
}
}
return "not enabled";
}