cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 763 Location: Eastman, GA
|
Posted: Wed May 25, 2011 2:17 pm Post subject: Wait for the Browser |
|
|
I've stated this in a couple of post, but I think I can nail it down best for those who look for help in the future here.
When using multiple dialog set,browser commands you absolutely must wait for the browser to be ready or experience unexpected results.
Thanks,
cnodnarb
BAD
Code: | dialog set,browser%%a1,"<html><body>RichEdit control by NodNarb compliant with <a href="http://www.vdsworld.com/forum/viewtopic.php?t=5154" target=_new>Request For Comment (RFC): VDS Built Custom Controls for VDS</a><p>Special credit to <a href='http://www.famfamfam.com/lab/icons/silk/' target=_new><font color=red>FAM</font><font color=blue>FAM</font><font color=green>FAM</font></a> for free glyphs!<p>Special credit to WidgetCoder for resize handling concept <a href='http://www.vdsworld.com/forum/viewtopic.php?t=3815' target=_new>DynPos</a><p>Special credit to Skit3000 for <a href="http://www.vdsworld.com/forum/viewtopic.php?t=2085" target=_new>DSU Resource Maker</a><p>Special credit to Codescript for <a href="http://www.vdsworld.com/forum/viewtopic.php?t=1735" target=_new>menu examples</a></body></html>"
dialog set,browser%%a1,javascript:document.getElementsByTagName('body')[0].style.overflow = 'hidden';void(0);
dialog set,browser%%a1,javascript:function clickIE4(){if (event.button==2){return false;}}function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){return false;}}}if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}document.oncontextmenu=new Function('return false');void(0);
|
GOOD
Code: | dialog set,browser%%a1,"<html><body>RichEdit control by NodNarb compliant with <a href="http://www.vdsworld.com/forum/viewtopic.php?t=5154" target=_new>Request For Comment (RFC): VDS Built Custom Controls for VDS</a><p>Special credit to <a href='http://www.famfamfam.com/lab/icons/silk/' target=_new><font color=red>FAM</font><font color=blue>FAM</font><font color=green>FAM</font></a> for free glyphs!<p>Special credit to WidgetCoder for resize handling concept <a href='http://www.vdsworld.com/forum/viewtopic.php?t=3815' target=_new>DynPos</a><p>Special credit to Skit3000 for <a href="http://www.vdsworld.com/forum/viewtopic.php?t=2085" target=_new>DSU Resource Maker</a><p>Special credit to Codescript for <a href="http://www.vdsworld.com/forum/viewtopic.php?t=1735" target=_new>menu examples</a></body></html>"
repeat
wait 0
until @not(@browser(browser%%a1,busy))
dialog set,browser%%a1,javascript:document.getElementsByTagName('body')[0].style.overflow = 'hidden';void(0);
repeat
wait 0
until @not(@browser(browser%%a1,busy))
dialog set,browser%%a1,javascript:function clickIE4(){if (event.button==2){return false;}}function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){return false;}}}if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}document.oncontextmenu=new Function('return false');void(0);
|
|
|