Daily Archives: 05.04.2013
Сжатие картинок
http://www.smushit.com/ysmush.it/ Сжимает PNG32 очень хорошо.
Отложенная загрузка скрипта в jQuery
| 
					 1 2 3 4 5 6 7 8 9 10 11 12  | 
						  function cachedScript (url, options)   {     // allow user to set any option except for dataType, cache, and url     options = $.extend(options || {}, {       dataType: "script",       cache: true,       url: url     });     // Use $.ajax() since it is more flexible than $.getScript     // Return the jqXHR object so we can chain callbacks     return jQuery.ajax(options);   }  | 
					
(чтобы скрипт кэшировался) http://jqapi.com/#p=jQuery.getScript
Наблюдение за изменениями части DOM-дерева
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  | 
						// select the target node var target = document.querySelector('#some-id'); // create an observer instance var observer = new MutationObserver(function(mutations) {   mutations.forEach(function(mutation) {     console.log(mutation.type);   });     }); // configuration of the observer: var config = { attributes: true, childList: true, characterData: true }; // pass in the target node, as well as the observer options observer.observe(target, config); // later, you can stop observing observer.disconnect();  | 
					
https://developer.mozilla.org/en-US/docs/DOM/MutationObserver