Skip to main content

Senior Web Engineer. Open web / music. Remote DJ. Tall Dutch guy. #3million

micro.blog/sander

svandragt

mixcloud.com/cloudseer

 

The magic of the web is that it’s a multiverse. When build progressively, information and services are usable even though certain technologies, such as autoplay and JavaScript, are disabled. My phone battery thanks all considerate developers!

 

It's wasteful to load all the site's css and javascript if the visitor only comes to visit one page.

 

The Milk Chocolate Peanut

Aaron Gustafson wrote back in 2008:

Getting into the progressive enhancement mindset is quite simple: just think from the content out. The content forms the solid base on which you layer your style and interactivity. If you’re a candy fan, think of it as a Peanut M&M:

The Chocolatey Layers of Progressive Enhancement

JavaScript first websites have the peanut inside out!

 

Hide elements that will be shown by jQuery later

I stumbled upon this gem by Jerph on Stackoverflow:

Right after the body tag, put a script tag with this javascript:

jQuery('body').addClass('js');

This gives you a style hook for any elements that will look different in some way when Javascript enabled, and it happens immediately.

via css - Hide jQuery Accordion while loading - Stack Overflow.

 

Asynchronous UIs - the future of web user interfaces

Discovered this javascript MVC framework SpineJS. The ToDo app is extremely impressive. Try and manipulate items as quickly as possible. Tthen close and reopen the browser. Nice.

via Asynchronous UIs - the future of web user interfaces.

 

 

[Plugin: WP List Files] Fix: links don't work when blog not installed in root of site

wp-list-filesUpdate: This plugin is no longer available.

We’re using a customized version of WordPress as an electronic portfolio for students and we are using WP List Files to make documents available on the ePortfolio. Unfortunately the WordPress support forums seem to hide my topic (possibly because it's an older version) and the author is no longer supporting the plugin.

Due to time constraints, these plugins are no longer supported and will not be updated, ever! Unless you know what you’re doing, I strongly discourage using these on a production blog since they have not been tested since WordPress 2.5.

The plugin didn't work in version 2.0.3 that we are using because the wp_enqueue_script function does not exist in this version  (the codex page does not say when this function was added). Anyway after manually adding the JavaScript to the theme's head element the plugin almost worked fine - links didn't take our folder structure into account.

works:
joeblogs.com</dir specified in post or page>

doesn't work:
allblogs.com/blogs/joebloggs</dir specified in post of page>

Fix it by replacing line 231 to read:

$files .= '

  • wpurl').$item['link'].'">'.$itemName.''.

 

The hyperlink created for the item didn’t have the complete blog URL in it. It assumed the blog was installed in the root of the domain. After this fix the plugin works fine.

 

Responsible browser vendors are hard to come by

Mike Davies works as a web developer for Yahoo Europe and has some insightful comments on the Internet Explorer rendering switch (see source).

When a user upgrades from IE7 to IE8, they will be upgrading from IE7 to IE7. When a user upgrades from IE8 to IE9, they will be upgrading from IE7 to IE7. Notice the trend. [...]
Effectively, with this meta tag proposal, Microsoft have either absolutely guaranteed that they will remain the dominant browser on the web, or it has sown the seeds for its ultimate destruction. If it's dominant IE7 will be the instrument to hold back all standards compliant progress, just like IE6 before it.

Source [isolani.co.uk]

I can only agree. It seems to me the switch will result in better fitting websites, but not by using more standards. But I noticed this at the whole Eolas patent debacle: the IE team doesn't take enough responsibility regarding standards. Even though the code was fine they wanted developers to implement a javascript workaround for their own workaround solution in all their pages with embedded content. They didn't want to (or couldn't) pay Eolas so people now have to click to start embedded media. Even though it's a browser issue.

And the same happens in this case: if the browser vendor took its responsibility and improved its implementation, the whole issue  wouldn't exist for webdevelopers' if their sites written to standards (and valid) don't display properly. So the whole "the users have to be protected from broken pages" card is a smoke screen in my opinion.

Just be frank then: corporate partners costcutting is more important to Microsoft than the freedom of the web.

 

Improving someone's code

Don't call your submit button 'submit' if you want to change the submit event with Javascript:

If you do, the browser (please read “Firefox 1.5 or IE 6? - that’s what I tested at the moment) will consider submit is an object. And an object is not a function (although you might enjoy later on the paradox that a function is an object).

Source [webprodevelopment.com]