IE5.0 has a faulty getElementsByName function. It exists just like it should, and it's a function just like it should be, and running it doesn't give any errors... But the result is wrong: the returned object has NO elements in it, and the length is 0, although it should be 2. Quite an annoying...
The following code would be a bit nicer: It'd work in Gecko browsers too, and it'd be more efficient:
get=document.all?document.all:
document.layers?function(d,l,_,i) {
if (!l) l=window;
l=l.document;
if (_=l[d])
if (_==l.applets[d]) return _;
else return _.style=_;
if (_=l.links[d])...
The offsetTop, offsetLeft, offsetHeight, and offsetWidth properties of HTML elements contain the values of an element's position and size as integers. These properties work in Internet Explorer 4+ as well as Netscape 6. - UNIMENT
One thing about Netscape is that it doesn't like thousands of calls to document.write in a short period of time. A better idea would be to create a string and concatenate it at every iteration, then document.write() it when it's done.
If that's not the cause of the problem, try looking into...
The replace method does not alter its parent object. Rather, it does its duty by returning the String on which the replacements took place.
tString=tString.replace(/"([^"]*)"/g, "$1"); - UNIMENT
document.menuFrame.document.layers[0].document.menuItem1
That is, if menuFrame is absolutely or relatively positioned. If it isn't positioned so, you'll have to access the ilayer as a direct child of the document. - UNIMENT
Okay... Now that it has been determined that the Option constructor can still be called as a function as long as parameters are passed to it, I'd like to know how you create functions that aren't constructed with Function (and without using the function keyword)?
thanks - UNIMENT
Yeah... I tested in IE6 only.
However, the results of this test show that it may be possible in JavaScript or even JScript to create a constructor that is not created by the Function function. For quite a while (must be months by now) I've made constructors, but only by creating functions. I'd...
Based on your posts, I can safely conclude that ... You don't quite understand what I'm talking about and you aren't quite capable of answering my question.
The Math object, if you haven't noticed, is not a constructor.
The Option object, if you haven't noticed, is a constructor. Also, if you...
trollacious, Yes I know all variables are supposedly objects. They all have toString() and valueOf() functions. In Netscape, you can watch() and unwatch() as well.
xutopia, have you ever tried calling the Option constructor without using the new keyword? You get an error! Try it!
The point I'm...
One of the things about versions of Netscape before 6 that makes me maddest is the inability to retrieve the HTML of an element. Try this:
<form><input /></form>
<script type="text/javascript">
alert(document);
alert(document.forms[0][0]);
</script>
If you tested the above code in...
Try this code on for size:
if (document.layers) document.captureEvents(Event.MOUSEUP);
document[document.layers?"onmouseup":"onclick"]=function(e) {
var s=e?e.target:event.srcElement;
if (s.hostname && s.hostname != location.hostname && (s.target == "" ||...
The reference I use most often is
http://developer.netscape.com/docs/manuals/communicator/jsref/contents.htm
Particularly, I use this reference whenever I need to learn something about the core. But as far as programming technique or DOM-access goes, you should do experimentation.
The OOP...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.