Include in the head of your HTML page.
jQuery 1.4.x
Note: This is NOT the same function as a jQuery(‘selector’).is(‘:blank’).
$.isBlank(" ") //true $.isBlank("") //true $.isBlank("\n") //true $.isBlank("a") //false $.isBlank(null) //true $.isBlank(undefined) //true $.isBlank([]) //true
$.isPresent(" ") //false $.isPresent("") //false $.isPresent("\n") //false $.isPresent("a") //true $.isPresent(null) //false $.isPresent(undefined) //false $.isPresent([]) //false
To run the tests, clone the repository and open ./spec/SpecRunner.html in any browser. For more info see jasmine.github.io/
I would like to expand the available utility/support functions. Submit a pull request with your patch and the appropriate Jasmine test. I’ll gladly merge your changes into master :)