JavaScript Performance Tuning Jeff D. Conrad 09/08/2011
  1. Performance Testing [ Tools ] [ Demos ]
  2. Resource Loading [ Strategy ] [ Tools ] [ Demos ]
  3. Functional [ Concepts ]
  4. Ajax [ Concepts ]
  5. Questions or Suggestions [ Q/A ]
[ Contents ]
Performance Testing Tools
Testing Tools Demos
Resource Tools
Resource loading strategy
  1. Required load (style then javascript)
  2. Ready state
  3. Pre-load/lazy loading
  4. Action-dependent/info-dependent
Packer Lazy Images Code
	
	<li id="prd_0" class="productView first">
	<img class="thumb"
		height="147"
		width="187"
		src="images/clear.gif"
		data-lazyimages-src="http://www.jostens.com/apps/shop/images/product/pchmp/FAN_RING1_GB030/browse.jpg"
	/>
	<img class="hover"
		height="297"
		width="331"
		src="images/clear.gif"
		data-lazyimages-src="http://www.jostens.com/apps/shop/images/product/pchmp/FAN_RING1_GB030/browse_hover.jpg"
	/>
Resource Tool Demos
Functional concepts
Ajax concepts
Enterprise Admin Echo Code
	
var echo = dateUtil.ms();
asset.buildCustomAssetList.lastEcho = echo;
$.ajax({
	url: asset.assetListUrl,
	dataType: 'json',
	data: {
		"customerKey": customerId,
		"echo": echo
	},
	complete: function() {
		progress.hide();
	},
	success: function(data) {
		if (ajaxUtil.isTimeout(data)) {
			ajaxUtil.doSignin();
			return;
		}
		if (asset.buildCustomAssetList.lastEcho != data.echo) {
			return;
		}
	...
ShineFx Progress Bar Code
	
// show the pbar
progress.show({msg: "Initializing...", w: 400});
	...
// just update the message
progress.msg("Preparing layouts...");
    ...
// hide the pbar
progress.hide();
Questions