<!--把下面代码放到<body>区域中-->
<SCRIPT>
function add()
{
var ress=document.forms[0].knowsky.value
window.location="view-source:"+ress;
}
</SCRIPT>
输入要查看源代码的URL地址:
<FORM><input type="text" name="knowsky" size=40 value="http://www"></FORM>
<FORM>
<INPUT type="button" value="查看源代码" onClick=add()>
</FORM>