/* Gets the timestamp of the start of the render, stored in the array page_speed_time.
......
/* Execute anonymous function Build Object Pagespeed * *
;(function () {
Pagespeed = {};/* There is no var keyword, which is equivalent to referring to window. Pagespeed *
/**
* Binding Createscript Method
*
* @param the value of the SRC attribute of the String a script label
* @param the value of the id attribute of a String B script label
*/
Pagespeed.createscript = function (A, b) {
var c = null;
if (document.getElementById (b)) {/* The script label already exists * *
c = document.getElementById (b)
} else {/* does not exist, create script label * *
c = document.createelement (' script ');
var d = null;
if (document.getelementsbytagname) {
D = document.getElementsByTagName (' head ') [0] | | Document.documentelement;
} else {
D = document.documentelement;
}
D.insertbefore (c, D.firstchild); /* Call the InsertBefore method to insert the newly created script label as the first child element.
}
* * Here the curly braces play the Code fragment grouping function.
{
C.setattribute (' type ', ' text/html ');
C.setattribute (' style ', ' display:none; ');
C.setattribute (' CharSet ', ' gb2312 ');
C.setattribute (' id ', b);
C.setattribute (' src ', a);
}
return C; /* Return to create a successful script tag element * *
};
/**
* Binding Submitdataforpagespeed Method
*
* @param object A map objects
*/
Pagespeed.submitdataforpagespeed = function (a) {
var B = {
' Name ': ',
' Rate ': 0
};
B.name = A.name;
B.rate = a.rate;
/* A.page_speed_time The last element of the array minus the first element * *
b[' 1 '] = a.page_speed_time[a.page_speed_time.length-1]-a.page_speed_time[0];
for (var i = 1; i < a.page_speed_time.length-1; i++) {
b[(i + 1) + '] = A.page_speed_time[i]-a.page_speed_time[0]
}
* * Submit Speed Test Results script/*
var c = ' http://pagespeed-ied.qq.com/r.cgi ';
/* Iterate through the elements of the B array, building query String * *
var d = [];
For (var p in b) {
D.push (p + ' = ' + b[p])
}
C + + '? ' + d.join (' & ');
/* Create script label Submit speed result
Pagespeed.createscript (c, ' submitforpagespeed ')
};
/**
* Binding Defaultsubmit Method
*
*/
Pagespeed.defaultsubmit = function () {
var a = ';
try {
A = Location.host
catch (e) {}
var B = {
' Name ': A,
' Rate ': 1,
' Page_speed_time ': []
};
if (!b.name) {
Return
}
if (! (typeof (Page_speed_time) = = ' object ' && page_speed_time instanceof Array)) {
Return
}
/* Get a new time stamp/*
Page_speed_time.push (New Date (). GetTime ());
B.page_speed_time = Page_speed_time;
/*
* I don't understand why we need a new variable AAA, can I use a directly?
* Try ... the catch structure is using a new variable AAAA but never used, why? Is it supposed to be AAA?
*/
var aaa = ';
try {
AAAA = Location.host
catch (e) {}
var c = Math.floor (Math.random () * 10000);
if (AAA = "ktv.qq.com" | | | | aaa = "ttd.qq.com" | | | aaa = "tian.qq.com" | | | aaa = "sura.qq.com" | |-AAA = "Gw.tnt.qq.com" | | AAA = "007.qq.com") {
c = Math.floor (Math.random () * 1000);
}
* * Random probability submission Data * *
if (c <= b.rate * 1) {
Pagespeed.submitdataforpagespeed (b);
}
};
/**
* Binding Submit Method (for CDN speed?)
*
* @param String a name
*/
Pagespeed.submit = function (a) {
var B = pagespeed.cdn_page_speed_submitdata;
var c = {};
For (var p in b) {
C[P] = b[p]
}
C.name = A | | C.name;
Pagespeed.submitdataforpagespeed (c);
}
})();
try {
* * 1 seconds to attempt to submit data * *
settimeout (function () {
Pagespeed.defaultsubmit ()
},
1000);
catch (e) {}
/* Last note, the second paragraph is a 32-bit 16-digit number, which should be similar to the ETAG used to mark the content version.
* |xgv00|ca82276cd78ac911d3d4310ba1408236 * *