注意是用到了, 下列的演示
<scriptLanguage = "javaScript"type = "text/javaScript">
adtime = 8;
Chancead = 1;
varns = (document.layers);
varie = (document.all);
varw3 = (document.getElementById &&! IE);
adcount = 0;
functioninitad () {
if (! ns &&! ie &&! w3) 반환;
if (ee) addiv = valit ( 'document.all.sponsoraddiv.style');
elseif (ns) addiv = valit ( 'document.layers [ "sponsoraddiv"]');
elseif (w3) addiv = valit ( 'document.getElementById ( "sponsorAddiv"). Style');
randad = math.ceil (math.random ()*chancead);
if (예 : || w3)
addiv.visibility = "Visible";
또 다른
addiv.visibility = "show";
if (randad == 1) showad ();
}
functionshowad () {
if (adcount <adtime*10) {adcount+= 1;
if (예 : documentwidth = docum
DocumentHeight = document.body.offsetheight/2+document.body.scrolltop-20;}
elseif (ns) {documentwidth = window.innerWidth/2+wind
DocumentHeight = Window.innerHeight/2+Window.PageyOffset-20;}
elseif (w3) {documentwidth = self.innerWidth/2+wind
DocumentHeight = self.innerHeight/2+Window.PageyOffset-20;}
addiv.left = documentwidth-100; addiv.top = DocumentHeight-0;
settimeout ( "showad ()", 100);}
}
functionclosead () {
if (예 : || w3)
addiv.display = "none";
또 다른
addiv.visibility = "숨기기";
}
함수 $ (obj) {
returnDocument.getElementById (OBJ);
}
functioncheckform () {
if ($ ( "file1"). value! = "")
{
if (/jpg| jpeg|gif|bmp/i.test ($ ( "file1"). value.match (//.(/w+) $/) [0] == 거짓) {
경고 ( "您只能上传图片文件");