Returns the window object where the context menu item was executed.
dhtml语法
[ oWindow = ] external.menuArguments
DHTML可能的值
oWindow | Variant that
receives where the context menu was opened. |
The property is read-only.
The property has no default value.
Remarks
This property is accessible only through script specified in the registry for a new context menu entry.
The menuArguments property returns an object reference of the window where the context menu was opened. The event object is exposed through this object reference, allowing authors to query the srcelement, clientx, and clienty properties.
for more information about how to implement extensions to the dynamic html(动态html,即dhtml)燿ocument object model (dom), see about the browser. for more information about how to add an entry into the standard context menus in microsoft® internet explorer, see adding entries to the standard context menu.
this property is not supported in html applications.
DHTML代码范例
This example uses the menuArguments property to change selected text to uppercase, or to insert text if nothing is selected.
<SCRIPT LANGUAGE = "JavaScript">
// Get the window object where the context menu was opened.
var oWindow = window.external.menuArguments;
// Get the document object exposed through oWindow.
var oDocument = oWindow.document;
// Get the selection from oDocument.
// in oDocument.
var oSelect = oDocument.selection;
// Create a TextRange from oSelect.
var oSelectRange = oSelect.createRange();
// Get the text of the selection.
var sNewText = oSelectRange.text;
// If nothing was selected, insert some text.
if (sNewText.length == 0){
oSelectRange.text = "INSERT TEXT";
}
// Otherwise, convert the selection to uppercase.
else{
oSelectRange.text = sNewText.toUpperCase();
}
</SCRIPT>
是否符合公共标准
There is no public standard that applies to this property.
Applies To