找回密码
 加入
搜索
查看: 5193|回复: 10

[IE类操作] 麻烦高手指点下如何调用这段js

[复制链接]
发表于 2010-10-23 22:05:17 | 显示全部楼层 |阅读模式
我尝试利用51.la的统计系统来统计我的软件有多少人在使用。
但是遇到个问题,找了多种方法都没办法执行js的统计代码。
特意来论坛求教高手们!
var a5346tf="51la";var a5346pu="";var a5346pf="51la";var a5346su=window.location;var a5346sf=document.referrer;var a5346of="";var a5346op="";var a5346ops=1;var a5346ot=1;var a5346d=new Date();var a5346color="";if (navigator.appName=="Netscape"){a5346color=screen.pixelDepth;} else {a5346color=screen.colorDepth;}
try{a5346tf=top.document.referrer;}catch(e){}
try{a5346pu =window.parent.location;}catch(e){}
try{a5346pf=window.parent.document.referrer;}catch(e){}
try{a5346ops=document.cookie.match(new RegExp("(^| )AJSTAT_ok_pages=([^;]*)(;|$)"));a5346ops=(a5346ops==null)?1: (parseInt(unescape((a5346ops)[2]))+1);var a5346oe =new Date();a5346oe.setTime(a5346oe.getTime()+60*60*1000);document.cookie="AJSTAT_ok_pages="+a5346ops+ ";path=/;expires="+a5346oe.toGMTString();a5346ot=document.cookie.match(new RegExp("(^| )AJSTAT_ok_times=([^;]*)(;|$)"));if(a5346ot==null){a5346ot=1;}else{a5346ot=parseInt(unescape((a5346ot)[2])); a5346ot=(a5346ops==1)?(a5346ot+1):(a5346ot);}a5346oe.setTime(a5346oe.getTime()+365*24*60*60*1000);document.cookie="AJSTAT_ok_times="+a5346ot+";path=/;expires="+a5346oe.toGMTString();}catch(e){}
a5346of=a5346sf;if(a5346pf!=="51la"){a5346of=a5346pf;}if(a5346tf!=="51la"){a5346of=a5346tf;}a5346op=a5346pu;try{lainframe}catch(e){a5346op=a5346su;}document.write('<img style="width:0px;height:0px" src="http://web1.51.la:82/go.asp?svid=16&id=4225346&tpages='+a5346ops+'&ttimes='+a5346ot+'&tzone='+(0-a5346d.getTimezoneOffset()/60)+'&tcolor='+a5346color+'&sSize='+screen.width+','+screen.height+'&referrer='+escape(a5346of)+'&vpage='+escape(a5346op)+'" />');
先多谢了!!!!
 楼主| 发表于 2010-10-24 08:53:18 | 显示全部楼层
没人能帮忙下吗.....期待!!!!
发表于 2010-10-24 09:10:56 | 显示全部楼层
本帖最后由 rolaka 于 2010-10-24 09:11 编辑
var a5346tf = "51la";
var a5346pu = "";
var a5346pf = "51la";
var a5346su = window.location;
var a5346sf = document.referrer;
var a5346of = "";
var a5346op = "";
var a5346ops = 1;
var a5346ot = 1;
var a5346d = new Date();
var a5346color = "";
if (navigator.appName == "Netscape") {
        a5346color = screen.pixelDepth;
} else {
        a5346color = screen.colorDepth;
}

try {
        a5346tf = top.document.referrer;
} catch(e) {}

try {
        a5346pu = window.parent.location;
} catch(e) {}

try {
        a5346pf = window.parent.document.referrer;
} catch(e) {}

try {
        a5346ops = document.cookie.match(new RegExp("(^| )AJSTAT_ok_pages=([^;]*)(;|$)"));
        a5346ops = (a5346ops == null) ? 1 : (parseInt(unescape((a5346ops)[2])) + 1);
        var a5346oe = new Date();
        a5346oe.setTime(a5346oe.getTime() + 60 * 60 * 1000);
        document.cookie = "AJSTAT_ok_pages=" + a5346ops + ";path=/;expires=" + a5346oe.toGMTString();
        a5346ot = document.cookie.match(new RegExp("(^| )AJSTAT_ok_times=([^;]*)(;|$)"));
        if (a5346ot == null) {
                a5346ot = 1;
        } else {
                a5346ot = parseInt(unescape((a5346ot)[2]));
                a5346ot = (a5346ops == 1) ? (a5346ot + 1) : (a5346ot);
        }
        a5346oe.setTime(a5346oe.getTime() + 365 * 24 * 60 * 60 * 1000);
        document.cookie = "AJSTAT_ok_times=" + a5346ot + ";path=/;expires=" + a5346oe.toGMTString();
} catch(e) {}

a5346of = a5346sf;
if (a5346pf !== "51la") {
        a5346of = a5346pf;
}
if (a5346tf !== "51la") {
        a5346of = a5346tf;
}
a5346op = a5346pu;
try {
        lainframe
} catch(e) {
        a5346op = a5346su;
}
document.write('<img style="width:0px;height:0px" src="http://web1.51.la:82/go.asp?svid=16&id=4225346&tpages=' + a5346ops + '&ttimes=' + a5346ot + '&tzone=' + (0 - a5346d.getTimezoneOffset() / 60) + '&tcolor=' + a5346color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a5346of) + '&vpage=' + escape(a5346op) + '" />');
整理一下嘛...瞪大眼睛看最后...

评分

参与人数 1金钱 +30 收起 理由
afan + 30

查看全部评分

 楼主| 发表于 2010-10-24 11:33:35 | 显示全部楼层
sorry....因为我不会js。。。
辛苦了!!!!
 楼主| 发表于 2010-10-24 11:51:44 | 显示全部楼层
还是没办法用au3运行啊!

我用这种方式调用的,把修改好的javascript代码放到1.js中:
Local $code=FileRead("1.js")
$oScript = ObjCreate("MSScriptControl.ScriptControl")
$oScript.Language = "JavaScript"
$oScript.AddCode($code)
$oScript.eval('counter()')
发表于 2010-10-24 11:53:56 | 显示全部楼层
还是没办法用au3运行啊!

我用这种方式调用的,把修改好的javascript代码放到1.js中:
kxing 发表于 2010-10-24 11:51

=.= 你的目的是啥?
document.write('<img style="width:0px;height:0px" src="http://web1.51.la:82/go.asp?svid=16&id=4225346&tpages=' + a5346ops + '&ttimes=' + a5346ot + '&tzone=' + (0 - a5346d.getTimezoneOffset() / 60) + '&tcolor=' + a5346color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a5346of) + '&vpage=' + escape(a5346op) + '" />');
它插入了一个图片 图片的地址里有参数 你拼一下地址 直接访问就可以了
 楼主| 发表于 2010-10-24 12:18:49 | 显示全部楼层
这个图片地址后面的运算是怎样的呢
楼上的辛苦下帮忙给各完整的例子好吗
目的只为了能让统计网站计算一次点击。
 楼主| 发表于 2010-10-24 12:25:55 | 显示全部楼层
直接访问 http://web1.51.la:82/go.asp 不行的,后面还有我的id。
如果加上 ?svid=16&id=4225346 也是无效点击,统计系统也没有记录。

下面这个就不知道怎么运算了。
&tpages=' + a5346ops + '&ttimes=' + a5346ot + '&tzone=' + (0 - a5346d.getTimezoneOffset() / 60) + '&tcolor=' + a5346color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a5346of) + '&vpage=' + escape(a5346op) + '"
 楼主| 发表于 2010-10-24 12:31:49 | 显示全部楼层
这个市51.la统计网站提供的不同统计代码。
正常的画室用在网站上的,我想把他用在软件里,这样就能统计多少人在用我的软件了。
1、<img 方式代码。( 可用在 淘宝网店、各种免费Blog 等不支持js的网页中 )
   注意: 这种方式无法对来路、关键词、搜索引擎进行分析。
<a href="http://www.51.la/?4225346" target="_blank"><img alt="我要啦免费统计" src="http://img.users.51.la/4225346.asp" style="border:none" /></a>

2、可置于js文件中的代码。
document.write ('<script language="javascript" type="text/javascript" src="http://js.users.51.la/4225346.js"></script>');

3、可置于独立框架中的代码 ( 详细说明 )
<script>var lainframe;</script>
<script language="javascript" type="text/javascript" src="http://js.users.51.la/4225346.js"></script>

4、简洁代码 ( 当用户端不支持或者禁止了js时, 此代码将无法对其访问进行记录 )
<script language="javascript" type="text/javascript" src="http://js.users.51.la/4225346.js"></script>
 楼主| 发表于 2010-10-24 18:09:50 | 显示全部楼层
是不是没办法解决呢,拜托大家了!!!
发表于 2010-10-25 17:23:13 | 显示全部楼层
...把
document.write('<img style="width:0px;height:0px" src="http://web1.51.la:82/go.asp?svid=16&id=4225346&tpages=' + a5346ops + '&ttimes=' + a5346ot + '&tzone=' + (0 - a5346d.getTimezoneOffset() / 60) + '&tcolor=' + a5346color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a5346of) + '&vpage=' + escape(a5346op) + '" />');
里的
document.write
换成
alert
alert('<img style="width:0px;height:0px" src="http://web1.51.la:82/go.asp?svid=16&id=4225346&tpages=' + a5346ops + '&ttimes=' + a5346ot + '&tzone=' + (0 - a5346d.getTimezoneOffset() / 60) + '&tcolor=' + a5346color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a5346of) + '&vpage=' + escape(a5346op) + '" />');
就可以看到地址了 或者你用ie8的话 用开发人员工具 ff的话用firebug...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 17:50 , Processed in 0.089148 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表