21 8 / 2012
Javascript Bundle: Detect HTML5 Placeholder Attribute Support - Syntactic Sugr
placeholderSupport = ("placeholder" in document.createElement("input"));
if(!placeholderSupport){
//This browser does not support the placeholder attribute
//use javascript instead
}
Forma rapidita de comprobar si un navegador soporta determinados atributos sin recurrir a Modernizr. Quien dice “placeholder” dice “autofocus”, por ejemplo.
04 10 / 2011
The Neon Javascript Library
Otra librería Javascript de 4Kb. Tiene buena pinta.
Features:
- CSS-based selection engine
- Cross-browser event handling
- Asynchronous loading of other Javascript
- AJAX and JSON decoding
- Animation with easing and custom functions
- DOM manipulation
- Style manipulation
- Calculation of element size and position
- Attribute and class manipulation
- Familiar method chaining syntax
01 10 / 2011
break the bit: Stripping HTML tags from a string in JavaScript
Here’s a clever one, I didn’t come up with it, but I sure want to disseminate it further.
Why bother with regular expressions and stuff when the browsers are more than suitable for the job:
String.prototype.strip_html = function() { var tmp = document.createElement("DIV"); tmp.innerHTML = this;...
16 9 / 2011