Posts Tagged “JavaScript”
Nov
08
2009
Pre-compressed JavaScript filesPosted by fli in General, tags: Apache, gzip, JavaScript, thttpdYou can save bandwidth by pre-compressing your JavaScript files with gzip without relying on dynamic compression such as mod_deflate. To to this properly and having it working across all browsers you’ll need to modify your webserver to return the correct mime type and encoding for the file. Most browsers are quite liberal in what they accept, except for Safari/Konqueror. For some reason it doesn’t like it if a JavaScript file ends in .gz, it ignores the content-encoding and attempts to read the compressed data as JavaScript. The key to make it work is to create a new extension, for example .jgz and set the Content-Encoding for this extension to gzip AND to set the mime type of .js to text/javascript, not text/plain or application/x-javascript. To recap, call the file script.js.jgz and make sure your webserver delivers it with the following options Content-Encoding: gzip Content-Type: text/javascript Just include the file as usual <script type="text/javascript" src="script.js.jgz"></script> This has been tested with the following browsers
ApachePut the following in a .htaccess file AddType text/javascript .js AddEncoding gzip .jsz thttpdAdd jsz gzip to mime_encodings.txt and change the type for js in mime_types.txt to js text/javascript.
Aug
05
2008
ShareIt! – Social Media Bookmark BarPosted by fli in General, tags: bookmark, JavaScript, share, social media, web 2.0
I previously used the service from addthis but never really liked it so I created my own, you’re free to use it if you like. It’s a simple script that is quite easy (guess it depends on who you ask…) to use and that generates bookmark/share buttons for popular services such as delicious, digg, facebook, twitter and more. Supports Delicious, Digg, StumbleUpon, Twitter, Technorati Favorites, Google Bookmarks, Facebook, Reddit, Diigo, Blogmarks, Blinklist and Magnolia This is a sample of how the bookmark bar could look, it’s possible to re-arrange and remove individual services if wanted. The icons are courtesy of http://fasticon.com/freeware/index.php/web-2-icons/ Follow this guide to get your own bookmark bar, you need some knowledge of how to edit HTML. |
Entries (RSS)