internet explorer - Using an Enumerator in JavaScript -
i have following vbscript code, express instead in javascript:
sub gxuiproxyvb_onlogon dim entityproxy each entityproxy in gxuiproxyvb.listentityproxy msgbox entityproxy.name next end sub
to give context code post-logon event handler of activex control's logon event. activex control hosted in web page running in internet explorer 8. user of web page triggers code's execution logging on via activex control's logon mechanism.
in code gxuiproxyvb reference activex control's object embedded in dom via html element.
this javascript have far:
function gxuiproxyvb::onlogon() { var entityproxy; // each entityproxy in gxuiproxyvb.listentityproxy // alert(entityproxy.name); // next }
i have commented out part struggling with: enumerating value of gxuiproxyvb.listentityproxy.
this screen shot ie8's watch list shows members of listentityproxy object
as workaround realize leave code in vbscript users using internet explorer access content, i'd rather have in javascript code maintainablity. (i don't want future web developers maintain code need proficient in vbscript.)
you'll have use enumerator object:
function gxuiproxyvb_onlogon() { var entityproxy; (var enr = new enumerator(gxuiproxyvb.listentityproxy); !enr.atend(); enr.movenext()) { entityproxy = enr.item(); alert(entityproxy.name); } }
Comments
Post a Comment