用隐藏的iframe来读取那个文件:
<iframe width=0 height=0 name=myIframe></iframe>myIframe.location.href='xxxxx.htm'然后用textareaElement.innerText = myIframe.document.body.innerHTML
<iframe width=0 height=0 name=myIframe></iframe>myIframe.location.href='xxxxx.htm'然后用textareaElement.innerText = myIframe.document.body.innerHTML
怎么用系统里的文件路径呢?
代替它呢
用 /xxxx/xxx.htm 这样的文件路径,其中根目录 "/" 就是你的 Web Server 的根目录。不可能访问 Web 路径之外的文件
<SCRIPT>
function onDownloadDone(s) { alert (s); }
</SCRIPT>
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
<P>Click <A HREF="javascript:oDownload.startDownload('main.htm',
onDownloadDone)">here</A> to download this page.main.htm文件不可以跨域
把它的源代码一字不漏的放到textbox框中..txt 的我就试过可以读出来。.HTML的源文件怎么读就请各大哥帮下了
<SCRIPT>
function onDownloadDone(s) { alert (s); }
</SCRIPT>
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
<P>Click <A HREF="javascript:oDownload.startDownload('file://c:/scan.htm',
onDownloadDone)">here</A> to download this page.
我依据你的代码,不行的为什么啊
按和HERE都没有反映。
<SCRIPT>
function onDownloadDone(s) { alert (s); }
</SCRIPT>
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
Please choicefile:<input type=file onchange="oDownload.startDownload(this.value,
onDownloadDone)">不可以跨域
是用IE里的控件么。
类试的还有些什么例子啊/在。ASPX里说没有权限
应该是IIS的原因吧