Click to See Complete Forum and Search --> : Dynamic Message Window


jackw
12-12-2002, 10:47 AM
I have a web page that I created that uses these JS pop up messages. Since I'm fairly new to web development (and JS), I pulled a stupid and didn't check to see if this script would work in Netscape. It's not major but I would like to be able to get to work in NS if possible. The error I get (through the Javascript console) is "add is not defined." Is there a way I can modify it to get it to work in NS.

This is the code from the JS script source web site.

<SCRIPT LANGUAGE="JavaScript">

function chen()
{
add.value="Web Site JavaScript Source \nhttp://javascript.internet.com/\nPart of the INT Media Group\nhttp://www.internet.com\nThanks for visiting us\nCome back soon!"
add.style.height=120
add.style.width=260
}
function dis()
{
add.value=""
add.style.height=0
add.style.width=0
}
</script>
:confused:

AdamGundry
12-12-2002, 01:18 PM
I think you need to use document.getElementById("add") in place of just add, in order to correctly reference the object in all browsers.

Hope this helps.

Adam

gil davis
12-12-2002, 04:33 PM
<rant>Why doesn't anyone post version numbers and other important specifics?</rant>

What version of NS?

What is "add" supposed to be? Did you create it somewhere? Is it an HTML object?

<rant>Is it bigger than a bread box? Animal or vegetable?</rant>

jackw
12-16-2002, 11:42 AM
The document.getElementById seems to work. I just have to do a little tweaking.

Thanks Adam

P.S.
:( gil.... Thanks for the reminder about versions and stuff.

I'm still somewhat new to developing and forget to include that stuff sometimes.

The script came from the internet.javascript.com (http://javascript.internet.com/messages/dynamic-message-window.html) website.

And I am trying to get it working specifically for NS 6.2 and above.