document.execcommand方法

 1<input type=button value=剪切 onclick=document.execCommand('Cut')>
 2<input type=button value=拷贝 onclick=document.execCommand('Copy')>
 3<input type=button value=粘贴 onclick=document.execCommand('Paste')>
 4<input type=button value=撤消 onclick=document.execCommand('Undo')>
 5<input type=button value=重做 onclick=document.execCommand('Redo') id=button2 name=button2>
 6<input>
 7<input type=button value=删除 onclick=document.execCommand('Delete')>
 8<input type=button value=黑体 onclick=document.execCommand('Bold')>
 9<input type=button value=斜体 onclick=document.execCommand('Italic')>
10<input type=button value=下划线 onclick=document.execCommand('Underline')>
11<input type=button value=停止 onclick=document.execCommand('stop')>
12<input type=button value=保存 onclick=document.execCommand('SaveAs')>
13<input type=button value=另存为 onclick=document.execCommand('Saveas',false,'c:\\test.htm')>
14<input type=button value=字体 onclick=document.execCommand('FontName',false,fn)>
15<input type=button value=字体大小 onclick=document.execCommand('FontSize',false,fs)>
16<input type=button value=刷新 onclick=document.execCommand('refresh',false,0)> 
17
18另外一些用法(参数1)
19
202D-Position 允许通过拖曳移动绝对定位的对象。 
21AbsolutePosition 设定元素的 position 属性为“absolute”(绝对)。 
22BackColor 设置或获取当前选中区的背景颜色。 
23BlockDirLTR 目前尚未支持。 
24BlockDirRTL 目前尚未支持。 
25Bold 切换当前选中区的粗体显示与否。 
26BrowseMode 目前尚未支持。 
27Copy 将当前选中区复制到剪贴板。 
28CreateBookmark 创建一个书签锚或获取当前选中区或插入点的书签锚的名称。 
29CreateLink 在当前选中区上插入超级链接,或显示一个对话框允许用户指定要为当前选中区插入的超级链接的 URL。 
30Cut 将当前选中区复制到剪贴板并删除之。 
31Delete 删除当前选中区。 
32DirLTR 目前尚未支持。 
33DirRTL 目前尚未支持。 
34EditMode 目前尚未支持。 
35FontName 设置或获取当前选中区的字体。 
36FontSize 设置或获取当前选中区的字体大小。 
37ForeColor 设置或获取当前选中区的前景(文本)颜色。 
38FormatBlock 设置当前块格式化标签。 
39Indent 增加选中文本的缩进。 
40InlineDirLTR 目前尚未支持。 
41InlineDirRTL 目前尚未支持。 
42InsertButton 用按钮控件覆盖当前选中区。 
43InsertFieldset 用方框覆盖当前选中区。 
44InsertHorizontalRule 用水平线覆盖当前选中区。 
45InsertIFrame 用内嵌框架覆盖当前选中区。 
46InsertImage 用图像覆盖当前选中区。 
47InsertInputButton 用按钮控件覆盖当前选中区。 
48InsertInputCheckbox 用复选框控件覆盖当前选中区。 
49InsertInputFileUpload 用文件上载控件覆盖当前选中区。 
50InsertInputHidden 插入隐藏控件覆盖当前选中区。 
51InsertInputImage 用图像控件覆盖当前选中区。 
52InsertInputPassword 用密码控件覆盖当前选中区。 
53InsertInputRadio 用单选钮控件覆盖当前选中区。 
54InsertInputReset 用重置控件覆盖当前选中区。 
55InsertInputSubmit 用提交控件覆盖当前选中区。 
56InsertInputText 用文本控件覆盖当前选中区。 
57InsertMarquee 用空字幕覆盖当前选中区。 
58InsertOrderedList 切换当前选中区是编号列表还是常规格式化块。 
59InsertParagraph 用换行覆盖当前选中区。 
60InsertSelectDropdown 用下拉框控件覆盖当前选中区。 
61InsertSelectListbox 用列表框控件覆盖当前选中区。 
62InsertTextArea 用多行文本输入控件覆盖当前选中区。 
63InsertUnorderedList 切换当前选中区是项目符号列表还是常规格式化块。 
64Italic 切换当前选中区斜体显示与否。 
65JustifyCenter 将当前选中区在所在格式化块置中。 
66JustifyFull 目前尚未支持。 
67JustifyLeft 将当前选中区所在格式化块左对齐。 
68JustifyNone 目前尚未支持。 
69JustifyRight 将当前选中区所在格式化块右对齐。 
70LiveResize 迫使 MSHTML 编辑器在缩放或移动过程中持续更新元素外观,而不是只在移动或缩放完成后更新。 
71MultipleSelection 允许当用户按住 Shift 或 Ctrl 键时一次选中多于一个站点可选元素。 
72Open 打开。 
73Outdent 减少选中区所在格式化块的缩进。 
74OverWrite 切换文本状态的插入和覆盖。 
75Paste 用剪贴板内容覆盖当前选中区。 
76PlayImage 目前尚未支持。 
77Print 打开打印对话框以便用户可以打印当前页。 
78Redo 重做。 
79Refresh 刷新当前文档。 
80RemoveFormat 从当前选中区中删除格式化标签。 
81RemoveParaFormat 目前尚未支持。 
82SaveAs 将当前 Web 页面保存为文件。 
83SelectAll 选中整个文档。 
84SizeToControl 目前尚未支持。 
85SizeToControlHeight 目前尚未支持。 
86SizeToControlWidth 目前尚未支持。 
87Stop 停止。 
88StopImage 目前尚未支持。 
89StrikeThrough 目前尚未支持。 
90Subscript 目前尚未支持。 
91Superscript 目前尚未支持。 
92UnBookmark 从当前选中区中删除全部书签。 
93Underline 切换当前选中区的下划线显示与否。 
94Undo 撤消。 
95Unlink 从当前选中区中删除全部超级链接。 
96Unselect 清除当前选中区的选中状态。
97
98

document.execCommand(”BackgroundImageCache”, false, true);

这样就能不缓存背景图

posted @ 2008-10-05 18:44  爱在戏院前  阅读(425)  评论(0编辑  收藏  举报