[Javascript] Date Script doesn't jive

Sara Coren SCoren at BREG.NET
Wed Apr 18 13:38:23 CDT 2001


Didn't work, and now there seem to be even more errors.  Thanks Tom.  If you
don't have any more time to help me with this, I'll understand.

Sara

-----Original Message-----
From: TomMallard [mailto:mallard at serv.net]
Sent: Wednesday, April 18, 2001 2:41 PM
To: javascript at LaTech.edu
Subject: Re: [Javascript] Date Script doesn't jive


Think I found it...

function imgoff(iname) {
      document[iname].src = eval( iname + "off.src");
      document["pic"].src = picoff.src;
}

The calling lines look like this...
<A HREF="index.htm" onmouseover=imgon('map9','9','0')
onmouseout=imgoff('map9')>

So, they're passing in a string, but document[] requires a collection
position not a string, my workaround adds a line to convert the string into
an image object...the alert will return [object] if it's OK...

function imgoff(iname) {
      var changedImage = eval("document." + iname);
alert(typeof(changedImage);
      changedImage.src = eval( iname + "off.src");
      document["pic"].src = picoff.src;
}

tom
----- Original Message -----
From: "Sara Coren" <SCoren at BREG.NET>
To: <javascript at LaTech.edu>
Sent: Wednesday, April 18, 2001 10:59 AM
Subject: RE: [Javascript] Date Script doesn't jive


> Thanks, I did what you suggested but it didn't make a difference.  In IE
it
> says that in Line 16, Char: 7, that 'document[...]' is null.  So I think
> you're right in that the object is null, but I would think that removing
the
> var iname = null; statement would help.  Should I also remove the iname
> reference in other parts of the script?
>
> Sara
>
> -----Original Message-----
> From: TomMallard [mailto:mallard at serv.net]
> Sent: Wednesday, April 18, 2001 2:02 PM
> To: javascript at LaTech.edu
> Subject: Re: [Javascript] Date Script doesn't jive
>
>
> Sara, try removing line 8....
>
> var iname = null;
>
> Just get rid of it, it looks like the calls do provide a value but since
> it's preset by line 8, the value you need gets ignored.
>
> tom
> ----- Original Message -----
> From: "TomMallard" <mallard at serv.net>
> To: <javascript at LaTech.edu>
> Sent: Wednesday, April 18, 2001 10:24 AM
> Subject: Re: [Javascript] Date Script doesn't jive
>
>
> > Sara, iname is never given a value, it's set to null at the top of the
> page
> > and never updated by anything from null...that's the problem.
> >
> > tom
> > ----- Original Message -----
> > From: "Sara Coren" <SCoren at BREG.NET>
> > To: <javascript at LaTech.edu>
> > Sent: Wednesday, April 18, 2001 9:25 AM
> > Subject: RE: [Javascript] Date Script doesn't jive
> >
> >
> > > Thanks Tom!
> > >
> > > Would you happen to how how to resolve this?
> > >
> > > I barely understand JS, so I don't really know how to do this.  What I
> > have
> > > to do is create an object that evaluates to eval( iname + "off.src"),
> > right?
> > > How do I create an object that would do this?
> > >
> > > This may be why the rollovers don't work in some versions of Netscape,
> but
> > I
> > > don't think it has anything to do with the timer and screen show not
> being
> > > happy with each other - do you?
> > >
> > > Sara
> > >
> > > -----Original Message-----
> > > From: Tom Mallard [mailto:mallard at mallard-design.com]
> > > Sent: Wednesday, April 18, 2001 12:31 PM
> > > To: javascript at LaTech.edu
> > > Subject: Re: [Javascript] Date Script doesn't jive
> > >
> > >
> > > Found an error using script debugger with IE5.5...
> > >
> > > function imgoff(iname) {
> > >       document[iname].src = eval( iname + "off.src"); <-------- object
> > error
> > >       document["pic"].src = picoff.src;
> > > }
> > >
> > > document[] is not an object...implying eval( iname + "off.src")
doesn't
> > > resolve to anything.
> > >
> > > tom
> > >
> > > ----- Original Message -----
> > > From: "Sara Coren" <SCoren at BREG.NET>
> > > To: <javascript at LaTech.edu>
> > > Sent: Wednesday, April 18, 2001 9:05 AM
> > > Subject: RE: [Javascript] Date Script doesn't jive
> > >
> > >
> > > > Thanks for your response, but I don't think any of the options you
> > listed
> > > > will work, because I don't want to interrupt one timer by another,
> since
> > I
> > > > want the date to constantly be on the page, although it doesn't
> include
> > > > minutes.  I also want the screen show to commence after a specific
> > period
> > > of
> > > > time (I think it's set up right now to go on after 20000, or 20
> > seconds.)
> > > >
> > > > If you could please look at the page, and the underlying code, that
> > would
> > > > really help you see what I'm talking about, and what I want to
> > accomplish.
> > > >
> > > > I don't think it's a variable name that is the same as in another
> script
> > > > because I've used <SCRIPT>, </SCRIPT> tags before and after each
> script
> > I
> > > am
> > > > implementing.
> > > >
> > > > The page is at http://home.earthlink.net/~score77/home.html
> > > > <http://home.earthlink.net/~score77/home.html>
> > > >
> > > > Many thanks,
> > > > Sara
> > > >
> > > > -----Original Message-----
> > > > From: BEKIM BACAJ [mailto:Trojani2000 at hotmail.com]
> > > > Sent: Wednesday, April 18, 2001 11:57 AM
> > > > To: javascript at LaTech.edu
> > > > Subject: Re: [Javascript] Date Script doesn't jive
> > > >
> > > >
> > > > Yes, timers interfere in between. They use alot of memory, and if
they
> > > never
> > > > stop, another timer that is invoket in meantime will not run
> smoothely.
> > > > There is a way to escape from this situation and it is: using the
same
> > > timer
> > > > for different timings.
> > > > But that is not allways possible. and another is to interrupt the
> other
> > > > timer tha is on, turn it off with the same function you invoke the
> newer
> > > > one. and back on when the second timer running is insuficient. Or
> there
> > is
> > > > another possibility.
> > > > Maby you're problem is caused with the same name variable and
similar.
> > You
> > > > can avoid it if you use diferent scripts placing them in different
> > > <script>
> > > > tags. That way they wan't enterfere.
> > > > Regards
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: Sara Coren
> > > > Sent: Wednesday, April 18, 2001 4:24 PM
> > > > To: 'javascript at LaTech.edu'
> > > > Subject: [Javascript] Date Script doesn't jive
> > > >
> > > > Hi there:
> > > >
> > > > I'm trying to use a "pre-fab" date script that I got off the a
> > Javascript
> > > > freebie site, and it screws with the other javascript that I am
using
> on
> > > the
> > > > page, for some ungodly reason.  I have a timer set up that gives a
> > screen
> > > > show of images that are declared within the script, and a pauser()
> that
> > > > delays the start of the screen show.  I am wondering if the clock
> script
> > > is
> > > > somehow interfering with the cycle() function initializing.  Anyhoo,
I
> > > hope
> > > > I'm explaining this correctly.
> > > >
> > > > The page with all the javascript in it can be seen at
> > > > http://home.earthlink.net/~score77/home.html
> > > > <http://home.earthlink.net/~score77/home.html>
> > > >
> > > > Thanks for your help!
> > > >
> > > > Sara
> > > >
> > > >
> > > >
> > > >   _____
> > > >
> > > > Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
> > > > <http://www.hotmail.com> .
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> > > http://www.LaTech.edu/mailman/listinfo/javascript
> > >
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> > > http://www.LaTech.edu/mailman/listinfo/javascript
> > >
> >
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > http://www.LaTech.edu/mailman/listinfo/javascript
> >
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list