var a = document.creatElement("a"); a.href="http://localhost:9999/FTP/myfile.rar "; a.target="_self"; a.innerText="我的文档";然后再合适的地方把这个A加进去就可以了。 比如div.appendChild(a);
var a = document.creatElement("a"); a.href="http://localhost:9999/FTP/myfile.rar "; a.target="_self"; a.innerText="我的文档"; document.appendChild(a);
a.href="http://localhost:9999/FTP/myfile.rar ";
a.target="_self";
a.innerText="我的文档";然后再合适的地方把这个A加进去就可以了。
比如div.appendChild(a);
a.href="http://localhost:9999/FTP/myfile.rar ";
a.target="_self";
a.innerText="我的文档";
document.appendChild(a);
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script type="text/javascript">
function showHistory() {
var ds=document.getElementById('ds');
var a=document.createElement("a");
a.herf="http://localhost:9999/FTP/myfile.rar";
a.target= "_self";
a.innerText="我的文档";
ds.appendChild(a);
}
</script>
<BODY onload="showHistory();">
<div id="ds"></div>
</BODY>
</HTML>这样好象没有连接功能了