日期:2014-05-16  浏览次数:20331 次

js中获得网页源代码
xml 代码
  1. '0000000.html'为你要打开的网页 ??
  2. 方法一: ??
  3. <HTML?XMLNS:MSIE?>??
  4. <MSIE:DOWNLOAD?ID="oDownload"?STYLE="behavior:url(#default#download)"?/>??
  5. <SCRIPT>??
  6. function?onDownloadDone(s)?{?alert?(s);?} ??
  7. </SCRIPT>??
  8. <P>Click?<A?HREF="javascript:oDownload.startDownload('0000000.html', ??
  9. onDownloadDone)">here</A>?to?download?this?page. ??
  10. 方法二: ??
  11. <script???language="JavaScript">?? ??
  12. ??function???onDownloadDone(data)???{???? ??
  13. ??alert(data);???? ??
  14. ??}???? ??
  15. ??</script>??? ??
  16. <input?type="button"?style="behavior:url(#default#download)"??value="获得代码"???onclick=this.startDownload("0000000.html",onDownloadDone)>?? ??
  17. 方法三: ??
  18. <script???language="JavaScript">?? ??
  19. ??function???getFileName()?? ??
  20. ??{?? ??
  21. ??var???url=window.location.href;?? ??
  22. ??//alert(url); ??
  23. ??var???pos=url.lastIndexOf("\\"); ??
  24. //如果是网上文件,路径分割符为"\\"?? ??
  25. ??//alert(pos); ??
  26. ??if??