Re: Challenges on JavaScript Techniques

On 7/11/05, Peter-Paul Koch <pp.koch@gmail.com> wrote:
> 
> Separation of behaviour and structure means
> 
> WRONG: <form action="somewhere.php" onsumbit="return validate()">
> 
> RIGHT: <form action="somewhere.php" id="validate">
> 
> window.onload = function () {
>   document.getElementById('validate').onsubmit = validate;
> 

No, This is not right, firstly it will error in many browsers, errors
are not accessible.

Secondly, it will mean that the documents behaviour will differ
between different loads of the document, inconsistency is not
accessible.

so whilst talking about seperation may be useful, changing the
behaviour of a page onload, or throwing script errors is not.

Jim.

Received on Monday, 11 July 2005 18:31:44 UTC