What is wrong with the following JS ? why do I get an error ?
What is the <![CDATA[...]]> you have around everything? You're doing assignments inside bracket notation. Also those < > you have around it are invalid JS. You've got quite a few errors and invalid JS. You're also negating the whole thing coercing it to a boolean value. I also can't tell what is supposed to be commented out as Facebook removed the newlines. Where did you find it?
the first code
Your link just goes to a login page.
Look at their code then at yours. Whatever this <![CDATA[..]]> is it's all commented out, but in yours you did not comment out the last part. It look like you have <![CDATA[ commented out but not ]]> which is invalid JS.
Nathan, CDATA is indeed valid. It's just legacy for use in XML/XHTML documents which most people don't use these days. You are right though, Dor should comment out the last ]]> part for it to work. Or better yet, just remove CDATA if his document doesn't use XHTML as doctype.