Have a Snippet?

Keep, track and share your code snippets with your friends

Category "JavaScript" (11)


JavaScript: Dumping tools and alias for development Share on Vkontakte

Use it for easy dumping variables
q() is alias for console.log()
w() is function, that displaying colorfull variable data like "var_export" to popup transparent div
based on this helpfull comment http://stackoverflow.com/a/7220510/2236189

Example: http://jsfiddle.net/ymmsA/
... Reveal Code


JavaScript: Добавить текст при копировании контента Share on Vkontakte

Добавить текст при копировании контента ... Reveal Code


JavaScript: Detect geolocation coordinates and adress Share on Vkontakte

Данный сниппет позволяет быстро получить не только координаты пользователя, но также его физический адрес.
Внимание! Требуется подключённая на страницу библиотека API 2.0 яндекс.карт.

Пример работы: http://jsfiddle.net/bnRus/ ... Reveal Code


JavaScript: Trim, Left Trim, Right Trim Share on Vkontakte

Trimming in Javascript As php analog ... Reveal Code


JavaScript: Send a POST request Share on Vkontakte

Send a POST request in the same way as it does form's submit. Was found here: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit ... Reveal Code


JavaScript: Declension of number (Склонение числительных) Share on Vkontakte

Example http://jsfiddle.net/v5nWh/ ... Reveal Code


JavaScript: Get random integer between min and max Share on Vkontakte

Get random integer between min and max ... Reveal Code


JavaScript: Get device pixel ratio (DPR) Share on Vkontakte

Returns pixel ratio based on devicePixelRatio or Media Query ... Reveal Code


Tracking the Facebook comments: creating and removing. You can use it to count the FB comments in the local database. ... Reveal Code


JavaScript: Email validation Share on Vkontakte

Validation of the entered email using regex ... Reveal Code