/ Published in: PHP
[Google's "AJAX Libraries API"](http://code.google.com/apis/ajaxlibs/) is great and all, but can slow things down if you're doing a lot of refreshing/cache clearing while debugging. Here's a neat trick: stuff something like this in the `` of your CakePHP Layout to use local versions of these libraries while you're debugging:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Google Ajax Libraries API handler for CakePHP * * Neat trick to load local versions of JavaScript libraries while * debugging, but Google-hosted versions for production. * Automatically detects whether debugging is turned on, and * defaults to jQuery, the best JavaScript library. * * Just shove it in your <head> and forget about it :) * I usually store it somewhere like: /elements/google-jsapi.ctp */ else $library .= '-local'; switch ($library) { case 'jquery': break; case 'jquery-local': break; case 'prototype': break; case 'prototype-local': break; }