20020107网页制作在线答疑资料整理

2005-1-16 15:16:00   Count:

1、问:如何在网页上显示访问者系统信息?
答:把以下代码加入到<Body></Body>:

<script Language="JavaScript">

document.write(navigator.appVersion)

</script>

2、问:怎么样在页面设置一个访问口令?
答:在<head></head>部分加入:

<script language="JavaScript"><!--

var pd=""

var rpd="yesky"

pd=prompt("请您输入密码:","")

if(pd!=rpd){

alert("您的密码不正确...")

history.back()

}else{

alert("您的密码正确!")

window.location.href="training.htm"

}

// --></script>

在以上代码中,"yesky"就是正确的密码。"training.htm"是当输入正确密码后链接的页面。

3、问:为图片设置链接时会有一个蓝色边框,怎么去掉?
答:如果我们设置了图片为一个链接,会发现图片四周出现了蓝色边框。要删除边框,需要在图片标签里加上border="0"。如:<img src="training.jpg" border="0">

4、问:我看到有些网页可以打开word文件,这是怎么做到的?
答:为了正确处理word等格式,你需要在HTML文件中设置好该文件类型,比如:

<meta http-equiv="Content-Type" content="Application/msword">

还有其它经常设置的文件类型:

Application/msword Microsoft Word Document

application/pdf PDF Document

application/wordperfect6.0 WordPerfect 6.0 Document

application/zip ZIP archive

audio/x-wav WAV audio format

audio/midi MIDI audio format

audio/x-pn-realaudio RealAudio

image/gif GIF image format

image/jpeg JPEG image format

image/png PNG image format

text/html HTML document

text/plain Plain text

video/mpeg MPEG video format

video/quicktime QuickTime video format

video/x-msvideo AVI video format

5、问:在设置了框架的网页中,怎么样才能做到单击一个链接后新打开的页面不是在框架中的?
答:在链接<A HREF>中加入TARGET="_TOP".如下设置:
<a href="http://training.yesky.com/" target="_top">天极网校</a>
当你单击了这个链接,页面所有框架被清除并以该链接内容替代。


浏览该文章的用户为您推荐了该信息: 
       
   
   
 
站内检索:
栏目导航
本月授课安排
阅读排行