Friday, April 15, 2011

Forcing Line-Breaks in a Cross-Browser Manner

This works in IE versions 6-9 as well as Firefox and Chrome:



This will force linebreaks in strings of really-really-really-really long text so that they do not overflow their container (ie: a DIV).

Thursday, April 14, 2011


Both Google and Microsoft have AJAX/JavaScript/jQuery CDNs.

Google works directly with the key stake holders for each library effort and accepts the latest stable versions as they are released. Once we host a release of a given library, we are committed to hosting that release indefinitely.
The Libraries API takes the pain out of developing mashups in JavaScript while using a collection of libraries. We make it easy for you to host the libraries, correctly set cache headers, and stay current with the most recent bug fixes.

By taking advantage of the Microsoft Ajax CDN, you can significantly improve the performance of your Ajax applications. The contents of the Microsoft Ajax CDN are cached on servers located around the world. In addition, the Microsoft Ajax CDN enables browsers to reuse cached JavaScript files for Web sites that are located in different domains.

Both Microsoft and Google’s CDNs support HTTPS as well as HTTP, so they can be included in both. They also include both minified and full versions of the jQuery scripts.

Documentation on Microsoft’s AJAX CDN is here:
An example of loading jQuery from Microsoft’s CDN:

Documentation on Google’s AJAX CDN is here:
An example of loading jQuery from Google’s CDN:
Google also has a “libraries API” so that JavaScript files can be loaded using code rather than inserting additional script tags: