All,
I am currently developing a UserJS "plug-in" for Opera in Linux using verision 9.21, build 641. I have encountered some bizarre problems and have been able to isolate and reproduce one using the code posted below. The basic issue throughout my code (and reproduced below) is that a command may either not execute, may execute incorrectly, or may execute differently depending on whether or not an alert() precedes it. Using Firefox, preceding the alert(hidden.contentDocument) command with another alert does not change anything (as well it shouldn't).
Has anyone else encountered this or have any suggestions? I cannot afford to have random alerts throughout my code (obviously).
Thanks in advance!
Louis
<html>
<body>
<script type="text/javascript">
var hidden = document.createElement('iframe');
hidden.src = "http://www.opera.com";
hidden.id = "iframe"
document.body.appendChild(hidden);
// if the below alert is commented out, the alert(hidden.contentDocument) command displays an alert box saying "null".
// if the below alert is not commented out, the alert(hidden.contentDocument) command displays an alert box saying "[object HTMLDocument]".
//alert("stuff")
alert(hidden.contentDocument)
</script>
</body>
</html>