RSS

Category Archives: web

Prefetching Files Using jQuery

>Since years, Gecko-based browsers have supported link prefetching, while other browsers (notably Internet Explorer) are lacking this function.

Here’s a simple JavaScript-based work-around based on jQuery:

$(document).ready(function() {

// Prefetch all files referenced in [LINK rel="prefetch" href="xyz"] tags...
var $prefetchTags = $('HEAD LINK[rel=prefetch][href]');

// ...starting with the ones that can be done asynchronously via AJAX...
$prefetchTags.filter('[href$=.txt],[href$=.js],[href$=.html]')
.each(function() {
$.ajax({url: this.href, dataType: 'text'});
});

// ...followed by all referenced images,
$prefetchTags.filter('[href$=.png],[href$=.jpg],[href$=.jpeg],[href$=.gif]')
.each(function() {
new Image().src = this.href;
});

It looks for all LINK tags in the HEAD section of the HTML document that have rel="prefetch" set.

Then it processes all HREF attributes, but treating text files and images differently, since text files can easily be downloaded using asynchronous HTTP requests (a.k.a. XMLHttpRequest or AJAX), while this method is not well-suited for fetching binary files.

This approach may be a bit rough on the edges, since I’ve only done limited testing, on Fireefox 3.0/Mac and MSIE 8.0/WinXP.

Advertisements
 

Browser News Updates (Feb 6, 2009)

>Here are some browser news updates:

 
Leave a comment

Posted by on 6 February 2009 in browser, browsers, news, web, www

 

Opera 10 Alpha Looks Promising

>Opera have released the first alpha of the new version 10 of their flagship product, Opera (for the desktop). Major changes include:

  • Presto 2.2 engine
  • 30% improved performance (at least this is what Opera claim)
  • support for web fonts
  • increased CSS 3 compliance (including RGBA and HSLA)
  • developer tool Dragonfly has been improved
  • Acid 3 compliance
  • support for the W3C Selectors API
  • improved HTML5 support

Other things, less important to web developers, include inline spell checking and automatic updates.

For more information, check out the detailed change logs for Windows, Linux/UNIX and Mac OS X. Note that big parts of those documents overlap eachother.

 
Leave a comment

Posted by on 5 December 2008 in browser, browsers, opera, opera10, web

 

A More Useful 404 (Not Found) Page

>There’s an interesting article over at the A List Apart site:

Definitely worth a read for web developers. It discusses some techniques to guess why somebody got to a 404 page and then takes action and displays info to the visitor based on that knowledge.

 
Leave a comment

Posted by on 18 November 2008 in 404, error, error page, not found, web, Web Development, webdev

 

Firefox Usage Up To 20%

>NetApps has provided some statistics regarding browser usage. According to their report:

Firefox usage is still climbing and now almost at 20%, while Internet Explorer usage is still decreasing and now down to just above 71%.

Of course, your mileage may vary, depending on the kind of site, your geographical location, etc.

But it is becoming more and more obvious that web developers programming Internet sites to Internet Explorer only are irresponsible and are causing issues for their employers and for the visitors of the sites.

An approach that works very well:

  • program to web standards, avoid JavaScript and Flash initially;
  • add JavaScript support to make things look better or work nicer (without disrupting the functionality for user agents without JavaScript);
  • add some Flash if you must, but have replacement content in case Flash is unavailable;

Benefits:

  • standards compliance;
  • accessibility for visually impaired is likely to be easy to achieve;
  • the same applies to Search Engine Optimization.
 

>Smooth web image zooming with FancyZoom

>

FancyZoom is a JavaScript library for zooming into images on a web page. It looks really well, zooming images smoothly when you click on them. And then when they show, they get a shadow effect applied.

The library works with most modern browsers: (Mobile) Safari, Firefox, IE6/7 and Opera are reportedly supported, but no word of Konqueror (KHTML). See it in action on here:

FancyZoom is free for non-commercial use. To use it commercially, the author asks $39 per site.

FancyZoom 1.1 comes with for 2 JavaScript files (34 KB) and 15 PNG image files (100 KB), which sums up to 134 KB. With current broadband connections it should not be a problem in itself, but it may add up to the total download size for a web page, especially for first-time visitors. Note that a compression tool like YUI Compressor may tighten the file sizes a bit.

 
 

>Quirksmode.org getting updated for latest browsers

>It seems that after a long time of relative quiteness, PPK is updating his site quirksmode.org again, to describe the features and quirks of the current browser incarnations IE 5.5–8b1, Opera 9.5b, Safari 3.1, Konqueror 3.5 and Firefox 2/3b5. Keep up the good work, Peter Paul!

Have a look at his blog:

 
Leave a comment

Posted by on 11 April 2008 in browser, browsers, ppk, standards, web