« May 2007 | Main | July 2007 »

June 2007 Archives

June 6, 2007

Cross-browser Event Handler Assignment

Making the client side scripts work across different major browsers is not easy, especially when client debugging is not as convenient as more strongly typed programming languages.  Try the following web page.  It works fine on IE but on FireFox clicking the button will trigger nothing to happen.

<html xmlns="http://www.w3.org/1999/xhtml" >
<
head><title>Untitled Page</title></head>
<
script language="Javascript">
function
document.onclick() {
  alert(
'doc event');
}
function foo() {
  alert(
'foo');
}
</script>
<
body>
<
input type="button" value="ok" onclick="foo();" />
</
body>
</
html>

The page will silently fail and none of the event handlers works.  Change the document.onclick handler assignment into the following and it works on both browsers.  Tools like the Error Console on FireFox is very helpful in diagnosing these type of errors.

...
document.onclick = function () {
  alert(
'doc event');
}
...

June 14, 2007

Yahoo! Mail Offering Unlimited Storage

 

Yahoo! Mail begins to roll out unlimited storage today worldwide.  Feeling lucky that minutes after their announcement, I'm getting this great offer already.  Now I don't need to worry about overflow any more. :)

About June 2007

This page contains all entries posted to Stanley Yao's Blog in June 2007. They are listed from oldest to newest.

May 2007 is the previous archive.

July 2007 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33