lautr.com

Hannes Blog for Development and Stuff besides

10. Oktober 2011
von Hannes
2 Kommentare

jquery slug plugin for input fields

A small jQuery Plugin i wrote to slug input fields, enjoy; (function( $ ){ function stringToSlug(str){ str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "àáäâèéëêìíïîòóöôùúüûñç·_,:;"; var to = … Weiterlesen

7. Juli 2010
von Hannes
Keine Kommentare

Convert all applicable characters to Numeric entities for use in XML

If you wanna make sure your text gets parsed correctly you mostly use htmlentities. However this method has 2 downsides: 1. It does not convert in to numeric entities so you’ll have problems when parsing as XML 2. It does NOT cover all characters that are like to show up. Weiterlesen