When frameworks try to be smart, AngularJS & Expressions

One of my colleagues just discovered this bug/feature in AngularJS. Using an ngIf on a string “no” will result in false. HTML: <div ng-app> <div ng-controller=”yesNoController”> <div ng-if=”yes”>Yes is defined, will display</div> <div ng-if=”no”>No is defined, but will not display on Angular 1.2.1</div> <div ng-if=”notDefined”>Not defined, will not display</div> </div> </div> JavaScript: function yesNoController($scope) { […]

jQuery submit button and button named submit

Suppose you have a button named "submit": <form method="post" action="" id="myForm"> <fieldset> <input type="text" name="myField" /> <input type="submit" name="submit" value="submit form" /> </fieldset> </form> And you want to submit this form with jQuery: <script type="text/javascript"> SomeFunction() { $("#myForm").submit(); } </script> That won’t work since you have a button named ‘submit’ which then screws up the […]