注意是用到了 , 下列的演示
<scriptuanguage = "javaScript" type = "text/javaScript">
adtime = 8;
Chancead = 1;
varns = (document.layers);
varie = (document.all);
varw3 = (document.getElementById &&! IE);
AdCount = 0;
functionInitad () {
if (! ns &&! dh &&! w3) return;
if (dh) addiv = eval ('document.all.sponsoraddiv.style');
elseif (ns) addiv = eval ('document.layers ["sponsoraddiv"]');
elseif (w3) addiv = eval ('document.getElementById ("sponsoraddiv"). style');
randad = math.ceil (math.random ()*chancead);
if (dh || w3)
Addiv.visibility = "sichtbar";
anders
addiv.visibility = "show";
if (randad == 1) showad ();
}
Funktionshowad () {
if (adCount <adtime*10) {adCount+= 1;
if (dh) {documentWidth = document.body.Offsetwidth/2+document.body.scrollleft-20;
documentHeight = document.body.offseteight/2+document.body.scrolltop-20;}
elseif (ns) {documentWidth = window.innnerwidth/2+window.pagexoffset-20;
documentHeight = window.innerHeight/2+window.pageyOffset-20;}
elseif (w3) {documentWidth = self.innnerwidth/2+window.pagexoffset-20;
documentHeight = self.innerHeight/2+Fenster.pageyOffset-20;}
addiv.left = documentwidth-100; addiv.top = documentHeight-0;
setTimeout ("showad ()", 100);}
}
funktionscLOSead () {
if (dh || w3)
Addiv.Display = "Keine";
anders
Addiv.visibility = "Hide";
}
Funktion $ (obj) {
returnDocument.getElementById (OBJ);
}
functionCheckform () {
if ($ ("Datei1"). Wert! = "")
{
if (/jpg|Jpeg|Gif|Bmp/i.test ($ ("file1"). value.match (//.(/ W+) $/) [0]) == false) {
alarm ("您只能上传图片文件");