Karen Nelson

Ranch Hand
+ Follow
since Aug 19, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karen Nelson

Oh... that makes sense, I guess. Thank you! One of those "javascript is not java" moments. -k
I noticed a behavior in javascript which seemed odd to me and was wondering if someone can explain. I get an array of elements using getElementsByTagName, i.e.,

At this point, the length of myArray is 3 (in my example).

If I then add an element with the same tagname (h1) to the DOM, and ask myArray for its length, and I get 4.

I would have expected that once myArray was populated, it would not be updated and the length would still be 3.

Here is my entire code (I know its not elegant, I was just trying to illustrate the point):

Is there a way to get an array which does NOT automatically update?

Hey, I figured it out (only took about 5 hours)...

I usually use "//-----" as a header for a block of functions that belong together. One time I messed up and wrote "//******", which should be OK but IE interpreted as beginning a comment. So nothing after that statement worked, and even stuff before it seemed unreliable at best.

I'm trying to decide if debugging with IE is more or less useful than a Ouija board.

The error message was the standard "object expected", followed by "identifier expected". The line numbers in the error message don't even correspond to lines that contain code in my files.

I call the function from window.onload, standard stuff.

It works perfectly in Mozilla. It also works perfectly as long as I define the function directly in the html file in a script tag, OR (I have since found out) if I make a new js file called util-DOM-2 and stick it in there. But of course I have already used the original util-DOM.js on a few hundred webpages. Is it possible for IE to think that the js file is somehow corrupted? Other functions in this file still work fine in IE.
I am having bizarre (to me) problems with js files and IE. Basically I have a webpage which loads a js file that has a bunch of utility-type functions that I've written. IE balks at one particular function within that file (Mozilla doesn't have any problem with it). When I move the function out of the js file and into the html file, IE then has no problem. If I move it back again, IE gives me an error.

Here is the function:

IE gets as far as the alert "id was string", then stops with the error.

Any ideas?

Thank you!! Karen.
[ February 04, 2007: Message edited by: Karen Nelson ]
arrrgh - yes, and now it does work. Thank you!
I am trying to create tables using DOM scripting, and my code works fine in netscape and firefox, but not IE. The code below is the simplest I can get it.

I put the tbody statements in because one google search turned this up, but it didn't help.

Thanks, Karen.
Its me again -- 5 seconds after I posted this I realized I needed to take out the quotation marks from false.

But, if anyone has read this far, why doesn't the setAttribute version work?

Sorry for the brain freeze, I really did spend a half hour messing around with it.

I am having trouble enabling and disabling buttons on forms I have created. As a simple example, I just want to enable the second button after the user clicks on the first button, but nothing I try works (or gives an error message, for that matter).

Thank you, Karen.

(extra letters in 'onloadd' and 'onclickk' to foil security)

The tricky part is getting over my head again. I tried calling this function from window.onload

but the code in knGraph.js is not accessible. I'm guessing this is because the page has already loaded so the js file never gets read. But I can't add any nodes with DOM scripting until after the page has loaded, right? So how do I do this?

Thank you again!
Hi again,
I have 4 external js files, and I'll probably eventually have more. I would like to list the external files in one metafile, then include that metafile on each page of my website. Is that possible? If I write a .js file with a bunch of <script src="whatever.js"> statements, I just get an error message.

If I could also put the css files in this metafile, that would be fantastic...
[ August 16, 2006: Message edited by: Karen Nelson ]
Thank you!!! Setting the overflow to hidden does work.
I am trying to write some javascript code to do simple graphics, using DOM scripting to add div's with background colors. The following code works perfectly in Netscape to produce a line which is one pixel high and 90 pixels long: (obviously replacing onloadd with onload)

but in IE it produces a rectangle that's about 10 pixels high -- about the height of a line of text, in fact.

So my question is, is there a way around this? Or some other way to draw a line in IE?

Thank you!!
Thanks to everybody who responded! I think I understand it better now -- especially, that I was approaching it from the wrong direction, trying to figure out what would be 'bad' about overriding a static method rather than thinking about the logic of the language.
I understand that static methods can't be overridden, but why? What disaster would happen if you were allowed to override a static method?
Thanks! Karen.