Document.execcommand () parsing

Source: Internet
Author: User
Tags format copy file upload insert reset set background window microsoft frontpage
Command

2d-position allows you to move an object that is absolutely positioned by dragging.
The position attribute of the AbsolutePosition setting element is "absolute" (absolute).
BackColor Sets or gets the background color of the currently selected area.
BLOCKDIRLTR is not currently supported.
BLOCKDIRRTL is not currently supported.
Bold toggles whether or not bold is displayed in the currently selected area.
Browsemode is not currently supported.
Copy copies the current selection to the Clipboard.
CreateBookMark creates a bookmark anchor or gets the name of the bookmark anchor for the current selection or insertion point.
Createlink inserts a hyperlink on the current selection, or displays a dialog box that allows the user to specify the URL of the hyperlink to insert for the current selection.
Cut copies the current selection to the Clipboard and deletes it.
Delete Deletes the current selected area.
DIRLTR is not currently supported.
DIRRTL is not currently supported.
EditMode is not currently supported.
FontName Sets or gets the font for the currently selected area.
FontSize Sets or gets the font size of the current selected area.
ForeColor Sets or gets the foreground (text) color of the currently selected area.
Formatblock sets the current block format label.
Indent increases the indentation of the selected text.
INLINEDIRLTR is not currently supported.
INLINEDIRRTL is not currently supported.
Insertbutton overwrites the current selection with a button control.
InsertFieldSet the current selected area with a box.
Inserthorizontalrule the current selected area with a horizontal line.
Insertiframe overwrites the current selection with an inline frame.
Insertimage overwrites the current selected area with an image.
Insertinputbutton overwrites the current selection with a button control.
Insertinputcheckbox overwrites the current selection with a check box control.
Insertinputfileupload overwrites the current selected area with a file upload control.
Insertinputhidden inserts a hidden control to overwrite the current selected area.
Insertinputimage overwrites the current selected area with an image control.
Insertinputpassword overwrites the current selection with a password control.
Insertinputradio overwrites the currently selected area with the radio buttons control.
Insertinputreset overwrites the current selection with the reset control.
Insertinputsubmit overwrites the currently selected area with the Submit control.
Insertinputtext overwrites the current selected area with a text control.
Insertmarquee overwrites the current selection with blank captions.
Insertorderedlist Toggles whether the current selection is a numbered list or a regular format block.
The insertparagraph overwrites the current selection with a newline.
Insertselectdropdown the Drop-down box control to overwrite the current selection.
Insertselectlistbox overwrites the current selection with a list box control.
Inserttextarea overwrites the current selection with multiple lines of text input controls.
Insertunorderedlist Toggles whether the current selection is a bulleted list or a regular format block.
Italic Toggle the current selection italic display or not.
Justifycenter the current selection in the format block where it is placed.
Justifyfull is not currently supported.
Justifyleft aligns the formatting blocks of the current selection to the left.
Justifynone is not currently supported.
Justifyright aligns the formatting blocks of the current selection to the right.
Liveresize forces the MSHTML editor to continuously update the appearance of the element during scaling or moving, rather than updating it after the move or zoom is complete.
Multipleselection allows you to select more than one site optional element at a time when the user holds down the Shift or Ctrl key.
Open is not currently supported.
Outdent reduces the indentation of the formatted block where the selected area is located.
OverWrite toggles the insertion and overwrite of the text state.
Paste overwrites the current selected area with the Clipboard contents.
Playimage is not currently supported.
Print opens a printing dialog box so that users can print the current page.
Redo is not currently supported.
Refresh refreshes the current document.
Removeformat removes the formatted label from the current selection.
Removeparaformat is not currently supported.
SaveAs saves the current Web page as a file.
SelectAll selects the entire document.
SizeToControl is not currently supported.
SizeToControlHeight is not currently supported.
SizeToControlWidth is not currently supported.
Stop is not currently supported.
Stopimage is not currently supported.
Strikethrough is not currently supported.
Subscript is not currently supported.
Superscript is not currently supported.
Unbookmark removes all bookmarks from the current selection.
Underline toggle the underline displayed in the current selection.
Undo is not currently supported.
Unlink removes all hyperlinks from the current selection.
Unselect clears the selected state of the current check area.
Document.execcommand (scommand[, interactive mode, dynamic parameters])

2d-position;document.execcommand ("2d-position", "false", "true"); objects that are absolutely positioned can be dragged directly; ie5.5
Absoluteposition;document.execcommand ("AbsolutePosition", "false", "true"), positioning the object to absolute positioning; ie5.5
Backcolor;document.execcommand ("BackColor", "false", scolor); set background color; ie4.0
Blockdirltr;none to make block-level elements typeset from left to right? does not support
Blockdirrtl;none to make block-level elements typeset from right to left? Bold;document.execcommand ("bold", "false", NULL) is not supported; the text in the selected area is bold; ie4.0
Browsemode;none, setting browser mode?; does not support Copy;
Document.execcommand ("Copy", "false", null); Copy the selected text to the Clipboard; ie4.0 Createbookmark;document.execcommand ("CreateBookMark "," false ", sanchorname); Sets the specified anchor point as a bookmark; ie4.0
Createlink;document.execcommand ("Createlink", "false", slinkurl); Turns the selected text into a hyperlink, and if the second argument is true, the Parameter Settings dialog box appears; ie4.0
Cut;document.execcommand ("Cut", "false", null); clipping selected text to clipboard; ie4.0
Delete;document.execcommand ("delete", "false", null); Delete the selected text; ie4.0
Dirltr;none: From left to right?; Dirrtl;none is not supported, the layout is from right to left. does not support
Editmode;none; set edit mode?; does not support
Fontname;document.execcommand ("FontName", "false", sfontname); Change the font of the selected area; ie4.0
Fontsize;document.execcommand ("FontSize", "false", ssize|isize); Change the font size of the selected area; ie4.0
Forecolor;document.execcommand ("ForeColor", "false", scolor); set foreground color; ie4.0
Formatblock;document.execcommand ("Formatblock", "false", stagname); Set the label name of the current block; ie4.0

<HTML>




<HEAD>
<script language= "JScript" >
/*
* This function performs the copy instruction.
*/
function Fn_doufucopy () {
Edit.select ();
Document.execcommand (' Copy ');
}
/*
* This function performs the paste instruction.
*/
function Fn_doufupaste () {
Tt.focus ();
Document.execcommand (' paste ');
}
__>
</SCRIPT>
<body>
<input Id=edit value= Example ><br>
<button onclick=fn_doufucopy () >Copy</button>
<button onclick=fn_doufupaste () >paste</button><br>
<textarea Id=tt rows=10 cols=50></textarea>
</body>
<meta http-equiv= "Content-type" content= "text/html; Charset=big5 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title>execcommand Finishing </title>
<script language=javascript>
/*
* This function is used to create a hyperlink
*/
function Fn_creatlink ()
{
Document.execcommand (' Createlink ', true, ' true ');/Bounce a dialog box enter URL
Document.execcommand (' Createlink ', false, ' http://www.51js.com ');
}
/*
* This function is used to set the selected area as the specified background color
*/
function Fn_change_backcolor ()
{
Document.execcommand (' BackColor ', True, ' #FFbbDD ');//true or false can be
}
/*
* This function uses the area in the selection as the specified foreground color, changing the size of the selected block, changing the character, and changing the character to a coarse skew
*/
function Fn_change_forecolor ()
{
Specify foreground color
Document.execcommand (' ForeColor ', false, ' #BBDDCC ');//true or false can be
Specify background color
Document.execcommand (' fontsize ', false,7); True or false can be
The word must be a system-supported word.
Document.execcommand (' FontName ', false, ' standard '); True or false can be
The word becomes thicker
Document.execcommand (' Bold ');
Change the oblique body
Document.execcommand (' italic ');
}
/*
* This function is used to add different lines to the selected area
*/
function Fn_change_selection ()
{
Add lines to the selected text
Document.execcommand (' underline ');
Line up the text in the selection
Document.execcommand (' strikethrough ');
Change some of the text in the selection
Document.execcommand (' superscript ');
To cancel the next line in the selected area.
Document.execcommand (' underline ');
}
/*
* This function is used to format the selected sections in different formats
*/
function Fn_format ()
{
Have sequence arrangement
Document.execcommand (' insertorderedlist ');
The heart is not arranged in sequence
Document.execcommand (' insertunorderedlist ');
Hollow unordered arrangement
Document.execcommand (' Indent ');
}
/*
* This function is used to cut or remove the selected area.
*/
function Fn_cutordel ()
{
Delete the area in the selection
Document.execcommand (' Delete ');
Cut down the area in the selection
Document.execcommand (' cut ');
}
/*
* This function is used to reset the selected area into an object
*/
function Fn_insobj ()
{
/*
******************************************
* The following instructions are to reset an object for the selected area;
* If there is no special description, the second argument true or false is the same;
* The number of parameters is represented by the ID of the object;
* You can control it by using the ID specified in JavaScript
******************************************
*/
/* Reset to a button (Insertbutton and Insertinputbuttong,
The former is a button, the latter is input) * *
/*document.execcommand (' Insertbutton ', false, "AA"); True or false is not valid
Document.all.aa.value= "Nine Days of wind Dance";
Reset to a FieldSet
/*document.execcommand (' InsertFieldSet ', True, "AA");
Document.all.aa.innertext= "A sword like a Dream";
Insert a horizontal line
Document.execcommand (' Inserthorizontalrule ', True, "AA");
Insert an IFRAME
Document.execcommand (' Insertiframe ', True, "AA");
Insert a insertimage, set to True when you need a picture, false without a picture
Document.execcommand (' Insertimage ', false, "AA");
Insert a CheckBox
Document.execcommand (' Insertinputcheckbox ', True, "AA");
Insert a file type of object
Document.execcommand (' Insertinputfileupload ', false, "AA");
Insert a hidden
/*document.execcommand (' Insertinputhidden ', false, "AA");
alert (document.all.aa.id);
Insert a Inputimage
/*document.execcommand (' Insertinputimage ', false, "AA");
Document.all.aa.src= "F-a10.gif";
Insert a password
Document.execcommand (' Insertinputpassword ', True, "AA");
Insert a radio
Document.execcommand (' Insertinputradio ', false, "AA");
Insert a Reset
Document.execcommand (' Insertinputreset ', True, "AA");
Insert a Submit
Document.execcommand (' Insertinputsubmit ', false, "AA");
Insert an input text
Document.execcommand (' Insertinputtext ', false, "AA");
Insert a TEXTAREA
Document.execcommand (' Inserttextarea ', True, "AA");
Insert a SELECT list box
Document.execcommand (' Insertselectlistbox ', false, "AA");
Insert a single Select
Document.execcommand (' Insertselectdropdown ', True, "AA");
Insert a line break (a hard return to the car??)
Document.execcommand (' insertparagraph ');
Insert a Marquee
/*document.execcommand (' Insertmarquee ', True, "AA");
document.all.aa.innertext= "BBBBB";
Used to cancel the shadow part of the selection.
Document.execcommand (' unselect ');
Select all the elements on the page
Document.execcommand (' SelectAll ');
}
/*
* This function is used to save the page as a file
*/
function Fn_save ()
{
The second reference is the file name you want to save
Document.execcommand (' SaveAs ', ' mycodes.txt ');
Print the entire page
Document.execcommand (' print ');
}
</script>
<body>
<input Type=button value= "Creative Createlink" Onclick=fn_creatlink () ><br>
<input Type=button value= "Change text background color" Onclick=fn_change_backcolor () ><br>
<input Type=button value= "Change text foreground color" onclick=fn_change_forecolor () ><br>
<input Type=button value= "to Text plus line" onclick=fn_change_selection () ><br>
<input Type=button value= "The alignment of changes in text" Onclick=fn_format () ><br>
<input Type=button value= "Delete or cut the selected part" Onclick=fn_cutordel () ><br>
<input Type=button value= "Insert Object" Onclick=fn_insobj () ><br>
<input Type=button value= "Save or print Files" onclick=fn_save () ><br>
<input Type=button value= "Test Refresh" >
</body>
The normal way is to activate a <iframe> into edit State, command as follows
Iframenamer.document.designmode= "On"

FONT--XXFarEastFont-Arial, blackbody, italics, etc.
ExecCommand ("FontName", "", font)
Font Size--sizes
ExecCommand ("FontSize", "", Font size)
Increase
ExecCommand ("Bold")
Italic body
ExecCommand ("italic")
Underline
ExecCommand ("Underline")
Delete Line
ExecCommand ("Strikethrough")
Superscript
ExecCommand ("superscript")
Subscript
ExecCommand ("Subscript")
Ordered arrangement--numeric serial number
ExecCommand ("Insertorderedlist")
Unordered arrangement--Dot ordinal
ExecCommand ("Insertunorderedlist")
Indent forward
ExecCommand ("Outdent")
Indent backwards
ExecCommand ("Indent")
Ju Zuo
ExecCommand ("Justifyleft")
Ju Right
ExecCommand ("Justifyright")
Center
ExecCommand ("Justifycenter")
Shear
ExecCommand ("Cut")
Copy
ExecCommand ("Copy")
Paste
ExecCommand ("Paste")
Covered
ExecCommand ("Overwrite")
Cancel Operation--ie5.0 can be canceled indefinitely
ExecCommand ("Undo")
Repeat action
ExecCommand ("Redo")
Set the link--if the following wording, in the IE5.0 version will activate a built-in window, you can complete the function of the input link, but also can choose Mailto, FTP and other types of links, more convenient
ExecCommand ("Createlink")
In IE4.0, there is no built-in link input window, so you need to embed the link in the following ways
ExecCommand ("Createlink", "" ", Turl)
Insert a picture-because the embedded editable controls in IE are for local resources, the default picture resources are local, so web content editors are best to make their own input boxes and then implement them with the following command.
ExecCommand ("Insertimage", "" ", Imgurl)
Font Color
ExecCommand ("ForeColor", "" ", Ccolor)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.