if cookie = ""

D

David Mark

Well to be honest, i didn't read your post in which you said "!==" is
wrong and "!=" is right. In your first reply you explained the

How do you figure that !== is "wrong." It is perfectly valid.
difference between "=" and "==" in your second post you were confused
about what the OP wants in your third post you told the OP that he was
doing opposite of color=="White which is color!="White which he was

Not technically the opposite operator, but logically he flip-flopped.
_not_ doing and in your fourth post, you made the same mistake
yourself. And in your fifth post you are telling me that I have

Make no mistake, I made no mistake.

gone

You did go bananas.
 
S

screechyboy

How do you figure that !== is "wrong." It is perfectly valid.


Not technically the opposite operator, but logically he flip-flopped.


Make no mistake, I made no mistake.

gone


You did go bananas.- Hide quoted text -

- Show quoted text -

Ok, Banana arguments aside i still dont have this code functioning as
i wish perhaps im going about it completly the wrong way!?!

Thanks to the above posts the code i now i have is:

<script type="text/javascript">
var color = getCookie("color");
if (color!=="White")
{
alert('Color = '+color+'!')
}
</script>

Ultimatley i would like it to perform a different action depending on
the value of the color cookie so i will definatly be needing an if
statement at some juncture. My problem is and always has been that
using this code the message box appears regardless of the value of the
cookie.
 
D

David Mark

On Sep 28, 11:52 am, "(e-mail address removed)"

[snip]
statement at some juncture. My problem is and always has been that
using this code the message box appears regardless of the value of the
cookie.

Actually, if you go back and find the post where I removed the cookie
processing from the equation, you will see that "White" won't alert.
This should be intuitively obvious if you understand what the !==
operator does.
 
T

Thomas 'PointedEars' Lahn

Please trim your quotes.

Ok, Banana arguments aside i still dont have this code functioning as
i wish perhaps im going about it completly the wrong way!?!

Thanks to the above posts the code i now i have is:

Thanks to the "above" (above? Google Groups is not the Usenet standard!)
posts, you have been mislead.
<script type="text/javascript">
var color = getCookie("color");
if (color!=="White")

!== is the strict inequality operator; the exact opposite of what you are
looking for: ==


PointedEars
 
S

screechyboy

Ok appologies i am as stated a newb and am using Googlegroups...

I have replace !== with just == now i dont get an alert at all.

My code is:

<script type="text/javascript">
var color = getCookie("color");
if (color=="white")
{
alert('Color = '+color+'!')
}
</script>
 
T

Thomas 'PointedEars' Lahn

Ok appologies i am as stated a newb and am using Googlegroups...

You could start by using proper language, and reading the FAQ and FAQ Notes
before you post.

http://jibbering.com/faq/
I have replace !== with just == now i dont get an alert at all.

And what do you expect now? The code is *syntactically* correct. Unless
you post a URL, one cannot verify whether or not it also fits the semantics
of your application.
My code is:

<script type="text/javascript">
var color = getCookie("color");
if (color=="white")
{
alert('Color = '+color+'!')
}
</script>

This is different from what you have posted previously: it is "white" here
and "White" there.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top