如何将系统已安装的字体作为select的选项全部显示出来?

1<select name="s" size="1">
2<option>楷体</option>
3<option>宋体</option>
4</select>

一看字体选项(option)这就是我在设计select时候手工添加的,我现在想问,能否通过什么手段直接!
---------------------------------------------------------------

1<object classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" height="0px" id="dlgHelper" width="0px"></object>
1<form name="form1">
2<select id="the_font" name="mm"></select>
3</form>
 1<script>   
 2function setFont()   
 3{   
 4var cnt = dlgHelper.fonts.count   
 5var e = document.form1.mm.options;   
 6for (var i=1; i<cnt; i++)   
 7{   
 8e[e.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));   
 9}   
10}   
11window.onload = setFont;   
12</script>

要IE5.5以上版本支持

Published At
Categories with Web编程
comments powered by Disqus