Internet Explorer 5.5Internet Explorer 6.0IEJScript .NET.NET CFVisual Studio .NET 2002.NET 1.0Visual Studio .NET 2003Windows 2003WebFormsVisual Studio 2005Windows 2000ASPWindows XP移动应用HTML中级开发Visual StudioJavascriptWindows.NETVisual BasicASP.NETC#
查看 ShowModalDialog 的源代码






3.31/5 (19投票s)
2005 年 9 月 12 日

65569
如何查看使用 ShowModalDialog 打开的窗口的源代码
引言
简单的问题... 在 Web 开发期间,如何查看使用 ShowModalDialog 产生的窗口的源代码?
在网页 <HEAD> 部分添加此 JavaScript<script language="javascript">
然后,在你的 <BODY> 中的任何位置添加以下 HTML
function viewSource()
{
d=window.open();
d.document.open('text/plain').write(document.documentElement.outerHTML);
}
</script>
<input type=button value="查看源代码" onclick="viewSource()">
是的,我知道,非常简单。 但我花了将近一个小时的搜索才弄明白。
尽情享受吧
=============== 编辑:请删除以下内容 ==================
CodeProject 向导需要更多的字数。 显然,一篇代码文章必须至少有 100 个字,否则向导会认为它包含的信息不够重要。 但不幸的是,这个示例非常快速且易于理解,因此不需要更多的字数。 这意味着我必须用这些垃圾填满 100 个字的限制(微笑),也许编辑会在文章发表前删除这些垃圾
=============== 编辑:请删除以上内容 ==================