Edward Barnard
Member since Jan 26, 2010
- Profile: /members/5276-edward-barnard.htm
- URL: http://ewbarnard.com/
- Comments: 2
Recent Blog Comments By Edward Barnard
-
Using Double Not-Operator (!!) For Boolean Type Casting
Posted on Jan 27, 2010 at 3:08 PM
@Ben, I found your excellent blog by searching for a way to trap jquery json-ajax errors. You gave me what I need; I can provide an error handler to $.ajax. Thank you! You make a good point about true/false/null as the success/failure value being a bit fishy. Remember that both PHP and Javascript ... read more »
-
Using Double Not-Operator (!!) For Boolean Type Casting
Posted on Jan 26, 2010 at 12:04 PM
A reason for using !== and === in javascript (and php) is when you are explicitly testing for a boolean value. When you truly want to know if it is TRUE or FALSE, you can get "fooled" by other non-boolean values getting typecast to the boolean value. For example, you are dealing with a function tha... read more »