注意是用到了 , 下列的演示
<scriptLanguage = "javascript" type = "text / javascript">
adme = 8;
ChanceAl = 1;
varns = (document.layers);
Varie = (document.all);
varw3 = (document.getElementById &&! ie);
AdCount = 0;
functionInitad () {
if (! ns &&! ie &&! w3) return;
if (ie) addiv = eval ('document.all.sponsoraddiv.style');
elseif (ns) addiv = evaling ('document.layers ["sponsoraddiv"]');
elseif (w3) addiv = evaling ('document.getElementById ("sponsoraddiv"). style');
randad = math.ceil (math.random () * Chancead);
if (ie || w3)
addiv.visibilité = "visible";
autre
addiv.visibilité = "show";
if (randad == 1) showad ();
}
functionShowad () {
if (AdCount <Adtime * 10) {AdCount + = 1;
if (ie) {documentWidth = document.body.offsetwidth / 2 + document.body.scrollleft-20;
documentHeight = document.body.offsetheight / 2 + document.body.scrolltop-20;}
elseif (ns) {documentWidth = window.innerwidth / 2 + window.pagexoffset-20;
documentHeight = window.innerheight / 2 + window.pageyoffset-20;}
elseif (w3) {documentWidth = self.innerwidth / 2 + window.pagexoffset-20;
documentHeight = self.innerheight / 2 + window.pageyoffset-20;}
addiv.left = documentWidth-100; addiv.top = documentHeight-0;
setTimeout ("showad ()", 100);}
}
functionclosead () {
if (ie || w3)
addiv.display = "Aucun";
autre
addiv.visibilité = "masquer";
}
fonction $ (obj) {
returnDocument.getElementById (OBJ);
}
FunctionCHECKForm () {
if ($ ("file1"). valeur! = "")
{
if (/jpg|jpeg|gif|bmp/i.test ($ ("file1"). value.match (//.(/ w +) $ /) [0]) == false) {
alerte ("您只能上传图片文件");