IE 6.0<HTML> <HEAD> <TITLE></TITLE> <SCRIPT type="text/javascript"> function getSystemFonts(){ var cnt = dlgHelper.fonts.count var str = "系统字体总数:" + cnt + "\n\n" var list = new Array() for (var i = 1; i < cnt; i++){ list.push(dlgHelper.fonts(i)) } alert(str + list.sort().join("\t")) } </SCRIPT> </HEAD> <BODY> <OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT> <INPUT TYPE="button" value="取得系统字体" onclick="getSystemFonts()"> </BODY> </HTML>
to bencalie(Bencalie): 在更低版本的IE中就没有办法取了吗?
Dialog Helper Object--------------------------------------------------------------------------------Provides access the color dialog box, as well as the block format and fonts collections. Members TableThe following table lists the members exposed by the Dialog Helper object. Click a tab on the left to choose the type of member you want to view. Collections
Show: Collections Methods Collection Description blockFormats Retrieves a collection of strings that specify the names of the available block format tags. fonts Retrieves a collection of all the system-supported fonts.
CollectionsMethodsMethod Description ChooseColorDlg Opens the system color-selection dialog box. getCharset Retrieves a Variant that specifies the character set of the specified font. ResTo create this object, use the OBJECT element and provide the class identifier (CLSID) for the dialog helper. ExampleThis code creates a dialog helper object which can be referenced by its id value.<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"> </OBJECT>
<HEAD>
<TITLE></TITLE>
<SCRIPT type="text/javascript">
function getSystemFonts(){
var cnt = dlgHelper.fonts.count
var str = "系统字体总数:" + cnt + "\n\n"
var list = new Array()
for (var i = 1; i < cnt; i++){
list.push(dlgHelper.fonts(i))
}
alert(str + list.sort().join("\t"))
}
</SCRIPT>
</HEAD>
<BODY>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<INPUT TYPE="button" value="取得系统字体" onclick="getSystemFonts()">
</BODY>
</HTML>
在更低版本的IE中就没有办法取了吗?
Show:
Collections
Methods
Collection Description
blockFormats Retrieves a collection of strings that specify the names of the available block format tags.
fonts Retrieves a collection of all the system-supported fonts.
CollectionsMethodsMethod Description
ChooseColorDlg Opens the system color-selection dialog box.
getCharset Retrieves a Variant that specifies the character set of the specified font. ResTo create this object, use the OBJECT element and provide the class identifier (CLSID) for the dialog helper. ExampleThis code creates a dialog helper object which can be referenced by its id value.<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px">
</OBJECT>