"jshanman" <unchartedweb@sbcglobal.net> wrote in message
news:1145903760.315751.97490@v46g2000cwv.googlegro ups.com...[color=blue]
> Marc Miller wrote:[color=green]
>> "Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message
>> news:6140311.i49f715iq9@PointedEars.de...[color=darkred]
>> > Marc Miller wrote:
>> >
>> >> When I click the button the 1st time, the code executes as expected.
>> >> Each
>> >> successive time I click the button, the same code executes which is
>> >> the:
>> >>
>> >> if (document.Form1.imgBug.src = "lbug.gif")
>> >> {
>> >> document.Form1.imgBug.src = "stopbug.jpg";
>> >> }
>> >>
>> >> And the source never switches back to 'lbug.gif'
>> >>
>> >>
>> >> What concept am I missing here?
>> >
>> > The difference between an assignment "=" and a comparison "==",
>> > and a reasonable Subject header.
>> >
>> > <URL:http://jibbering.com/faq/>
>> >
>> >
>> > PointedEars[/color]
>>
>>[color=darkred]
>> > --
>> > This above all: To thine own self be true.
>> > -- William Shakespeare (1564-1616)[/color]
>>
>>
>> Thomas,
>>
>> Thanks for your response and you're right, a reasonable subject header is
>> much more appropriate.
>>
>> Interestingly enough, I used the comparasion "==" in my first attempt (
>> in
>> the 'if' and 'else if' lines) and nothing happened.
>>
>> I then changed it to the assignment "=" and, voila, the 'if' line works
>> all
>> the time, except that it does not
>> correctly identify the 'src' attribute of the image.
>>
>> I tried using 'switch' but that seems not to be an option at all.
>>
>> By the way, my platform it asp.net 2003, .NET framework 1.1.
>>
>> Thank again,
>> Marc Miller[/color]
>
> Use the "==" operator, then send an alert if it is not true so you can
> see what the value is. It may be adding
> "http://www.yourdomain.com/your/path/to/image" to the string as it
> loads the image. Thus you would need:
>
> if (document.Form1.imgBug.src ==
> "http://www.yourdomain.com/your/path/to/image/lbug.gif") {
> document.Form1.imgBug.src =
> "http://www.yourdomain.com/your/path/to/image/stopbug.jpg";
> }
>
> - JS
>
http://www.endeavorpub.com
>[/color]
JS,
That does work, and with the '==' operator and the fully qualified path. I
was
trying to avoid having to change the domain in the path however, to save the
necessity of changing the string every time there is a version
change/testing/and move
to production.
Thanks to all!
Marc Miller