¹®¼¿¡¼ execCommand¸¦ »ç¿ëÇÏ¿© ÁöÁ¤µÈ ¸í·ÉÀÌ ¼º°øÀûÀ¸·Î ¼öÇàµÇ¾ú³ª¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀ» ¹ÝȯÇÑ´Ù.
¸í·É¾î »ç¿ëÀÌ °¡´ÉÇÑ°¡¸¦ ºÎ¿ï°ªÀ¸·Î ¹ÝȯÇÑ´Ù.
true | ±× ¸í·É¾î »ç¿ëÀÌ °¡´ÉÇÏ´Ù. |
false | ±× ¸í·É¾î »ç¿ëÀÌ ºÒ°¡´ÉÇÏ´Ù. |
TextRange °³Ã¼¿¡¼ queryCommandEnabled('delete')¸¦ »ç¿ëÇϸé true¸¦ ¹ÝȯÇÏ°í,
document °³Ã¼¿¡¼ queryCommandEnabled('delete')¸¦ »ç¿ëÇϸé false¸¦ ¹ÝȯÇÑ´Ù.
±×·¯³ª execCommand('delete')µµ ¼±ÅÃµÈ ÅؽºÆ®¸¦ »èÁ¦Çϱâ À§ÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ´Ù.
°³Ã¼ | script | IE |
---|
ÁÖ¾îÁø ¸í·É¿¡ µû¸¥ °ü·Ã °ªÀ» µð½ºÇ÷¹ÀÌÇÑ´Ù.
<BUTTON onClick="QueryCommand()">¸í·É¿¡ µû¸¥ °ü·Ã °ª ¾ò±â</BUTTON> <SCRIPT language=VBScript> Sub QueryCommand() '¸í·ÉÀÌ ¹®¼ÀÇ »óÅ¿¡¼ ¼öÇàµÉ ¼ö Àִ°¡¸¦ Ãâ·ÂÇÑ´Ù. Dim objApp As FrontPage.Application Dim objDoc As DispFPHTMLDocument Dim strUser As String Dim strYN Set objApp = FrontPage.Application Set objDoc = objApp.ActiveDocument strUser = InputBox("¼öÇàÇÒ ¸í·ÉÀ» ÀÔ·ÂÇ϶ó.") If objDoc.queryCommandEnabled(cmdID:=strUser) = True Then strYN="°¡´ÉÇÏ´Ù." Else strYN="°¡´ÉÇÏÁö ¾Ê´Ù." End If MsgBox "ÀÌ ¸í·É(" & strUser & ")ÀÌ ¼öÇà " & strYN End Sub </SCRIPT>