Noty looks good
Posted: February 14th, 2012 | Author: Vincent | Filed under: Development, JavaScript | No Comments »http://needim.github.com/noty/
jQuery Performance Tips
Posted: December 15th, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/
Some notes from reddit:
#6 There is little to no performance difference between a cached selector and chaining. The ONLY difference would be shorter code (less bandwidth used?).
#9 This is just plain wrong. DOM manipulation can be extremely fast if you know what you are doing. He uses this example
The faster way to do this would be
frag = $('<ul id="menu"></ul>');
listItem = $('<li></li>')
for (var i = 1; i < 100; i++) {
frag.append(listItem.clone().text(i));
}
$('#header').prepend(frag);
#14 Use jQuery’s utility functions
“.each(), for example, relies on anonymous function calls. This can be REALLY slow”
#15 not really much of a performance tip
#16 is REALLY finicky and hard to profile.
Two interesting jQuery plugins
Posted: November 21st, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »CSS3 based jQuery Gallery
Posted: September 5th, 2011 | Author: Vincent | Filed under: CSS, JavaScript | No Comments »YUI Compressor for JavaScript
Posted: September 2nd, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »# $1 input file # $2 output file java -jar yuicompressor.jar $1 -o $2
yuicompressor.jar is attached.
source: http://yuilibrary.com/download/yuicompressor/
Google event tracking
Posted: August 30th, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »
$(document).ready( function() {
// add an event to all link for google analytics
$('a').click(function () {
// tell analytics to save event
try {
var identifier=$(this).attr('id') ;
var href=$(this).attr('href')
var label="";
if ( typeof( identifier ) != 'undefined' ) {
label=label+'[id]:'+identifier
category='JSLink'
}
if ( typeof( href ) != 'undefined' ) {
label=label+' [href]:'+href
if ( href[0] == '#' ) {
category='Anchor';
} else {
category='Link';
}
}
_gaq.push(['_trackEvent', category, 'clicked', label]);
// console.log('[tracked]: ' + category + ' ; clicked ; ' + label );
}
catch (err) {
// console.log(err);
}
// pause to allow google script to run
var date = new Date();
var curDate = null;
do {
curDate = new Date();
} while (curDate-date < 300);
});
});
Source: External blog
Make JavaScript calls within ActionScript 3
Posted: August 30th, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »
import flash.external.ExternalInterface;
var returnedValue:int = ExternalInterface.call("foobar()", "argument");
Best practice for loading jquery, and other JavaScript libs
Posted: August 4th, 2011 | Author: Vincent | Filed under: Development, JavaScript | No Comments »
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/VERSION.NUMBER/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script src="js/jquery.js" type="text/javascript">\x3C/script>')</script>
Activity Indicator – A imageless loading animation plugin
Posted: January 31st, 2011 | Author: Vincent | Filed under: JavaScript | No Comments »http://neteye.github.com/activity-indicator.html
Make AJAX and JavaScript paging work nice with SEO and Browser history
Posted: December 15th, 2010 | Author: Vincent | Filed under: JavaScript | No Comments »http://code.google.com/web/ajaxcrawling/
http://www.mikage.to/jquery/jquery_history.html
http://en.wikipedia.org/wiki/JSON#JSONP
Slidenote
Posted: October 21st, 2010 | Author: Vincent | Filed under: Development, JavaScript | No Comments »Fancybox
Posted: July 18th, 2010 | Author: Vincent | Filed under: JavaScript | No Comments »This seems to be a very good jQuery plugin for “lightbox” effect and it supports image with caption, html content, ajax page, etc.
Performance difference in JavaScript
Posted: June 9th, 2010 | Author: Vincent | Filed under: JavaScript | 2 Comments »LearningjQuery has an interesting article about different speeds of show and hide html elements.
From fast to slow:
jQuery toggle seems to fail pretty bad speed wise, while the “Enabling/Disabling a stylesheet” seems to be such an usual approach and probably make it confusing to a lot web develoeprs (yours truly included: would have said WTF if hadn’t read the article).
I’d go with .css(‘display’, ”), .css(‘display’, ‘none’) in the case where performance is important (i.e. multiple, alot of layers to be hidden or shown), and in other case, .show()/hide() or even toggle() seems to be fine to me. “Program Readability” > “Performance” in a lot of situations.
jQuery: Two new jQuery plugins
Posted: July 8th, 2009 | Author: Vincent | Filed under: JavaScript | No Comments »JQuery alert/confirm
http://abeautifulsite.net/notebook/87
JQuery popeye
http://herr-schuessler.de/blog/jquerypopeye-an-inline-lightbox-alternative/
jQuery: a few jQuery collections
Posted: June 24th, 2009 | Author: Vincent | Filed under: JavaScript | No Comments »- http://stanlemon.net/projects (jgrowl)
- http://malsup.com/jquery (blockUI)
- http://brandonaaron.net/code (liveQuery)
- http://trentrichardson.com/Impromptu/index.php
jQuery: Prefetch
Posted: June 11th, 2009 | Author: Vincent | Filed under: JavaScript | Tags: JavaScript | No Comments »
(function($) {
$.ajax({ url:"/js/file1.js", cache:true, dataType:"text" });
$.ajax({ url:"/js/file2.js", cache:true, dataType:"text" });
})(jQuery);