收 藏 投 稿 繁 体 RSS 
站长吧-中国站长学习与交流的网站
首 页 运 营 学 院 建 站 论 坛
Web master8.net  
 网站运营  
  欢迎在本站发布信息,在线投递稿件请点这里。编辑QQ:4908220,欢迎联系交流。
业界动态 创业故事 推广研究 策划盈利 电子商务 企业平台
  站长工具
SEO查询 Whois查询 Pr查询 域名查询 IP查询 网页编辑器
 建站服务  
  如有建站意向,请尽快联系我们,以便安排时间... 建站服务 QQ4908220 QQ:4908220
作品展示 服务范围 服务流程 服务报价 联系方式 付款方式
文章正文  » 您的当前位置: 首页 >> 学院 >> 网页设计 >> Javascript
Javscript获取客户端常用信息
  来源:本站原创 作者:年华 | 时间:2006-11-30 | 浏览:   相关评论 | 报告错误 | 发布文章
【字号: | | 】 【背景色 杏仁黄 秋叶褐 胭脂红 芥末绿 天蓝 雪青 灰 银河白(默认色)

Javscript获取客户端常用信息,做访问统计比较有用...

<script type="text/javascript">
p = window.navigator.userAgent;//OS
document.write(p);
document.write("<br>");


v = navigator.appName;//浏览器
document.write(v);
document.write("<br>");

if(v != "Netscape")//颜色深度
{
 c = screen.colorDepth;
} else {
 c = screen.pixelDepth;
}
document.write(c);
document.write("<br>");

s = screen.width+"x"+screen.height;//分辨率
document.write(s);
document.write("<br>");

t = escape(document.title);//被访问页面标题
document.write(t);
document.write("<br>");

l = window.location;//被访问页面地址
document.write(l);
document.write("<br>");

var f = "";//来源页面

// if pp_frames is true then try getting the framed referral (without error checking)
if (typeof(pp_frames) != "undefined")
 if (pp_frames)
   f = top.document.referrer;

// get the referral for non-multi-domained-framed sites using a Netscape browser
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
 if (document["parent"] != null)
   if (parent["document"] != null) // ACCESS ERRor HERE!
     if (parent.document["referrer"] != null)
       if (typeof(parent.document) == "object")
         f = parent.document.referrer;

// get the referral for the current document if a framed referral wasn't found
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
 if (document["referrer"] != null)
   f = document.referrer;

// convert all the unknown's into blank
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
 f = "";

// escape the referral
f = escape(f);

document.write(f);
document.write("<br>");

//判断Alexa工具条 1安装 0未安装
document.write("<script language=\"javascript\" src=\"res://AlxRes.dll/SCRIPT/dsn.class.js\"><\/script>");
function doTryAlexa()
{
 try
 {
   aborted();
   return 1;
 }
 catch(e)
 {
   return 0;
 }
}
a = doTryAlexa();
document.write(a);
</script>

 

master8
  • 上一篇:prototype.js开发者手册
  • 下一篇:Skype出台海外赔偿方案

  • 我要投稿  打印本文  推荐本文  加入收藏  返回顶部  关闭窗口
    搜模板(www.somoban.com) 原创网站模板交易平台
    阿里妈妈再掀疯狂采购风,网站广告位严重告急,急召天下站长
    基于PHP+MySQL的整站、模块、插件开发等或者按需求实现相应功能;
基于各PHP主流建站系统CMS,BBS,BLOG等的模板定制,完全手写代码;
整站数据迁移或备份恢复;网页代码优化、重构;整站常规SEO优化;网站技术支持;
点击了解详情...
    站长论坛
    • 验证码: