Joined June 2012
·

Emanuel

neuwaerts
·
Hanover, Germany
·
·
·

Posted to Hide placeholder on :focus in webkit over 1 year ago

Big accessibility fail! Makes me sad to see this nonsense gets promoted by the official Coderwall twitter-account … :-(

Posted to Convert A Title Into Url Slug over 1 year ago

You're missing special chars here. The title "Der süße Vogel isst Flöhe" would become der-s-e-vogel-isst-fl-he. You could omit special chars in general with something like this: encodeURIComponent('<some string>'.replace(/\s+/g, '-')).replace(/\%.{2}/g, ''), but actually the best solution is to replace every special char with an appropriate ASCII equivalent, like: '…'.replace(/ä/ig, 'ae').

Additionally you could use this.value instead of $(this).val(). There' no need to instantiate a jQuery-object.

Useful tip!

Btw: instead of document.getElementsByTagName("html")[0] you can use document.documentElement.

Achievements
125 Karma
2,257 Total ProTip Views