cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjos...@gmail.com>
Subject Re: bug with double-listbox?
Date Sun, 09 Nov 2008 15:04:00 GMT
Got it...works nicely now, with the line uncommented!

Thanks again, I sure do appreciate it.

rgds
Paul

Jason Johnston wrote:
> On 11/09/2008 07:41 AM, Paul Joseph wrote:
>> well...the code below seems to work fine on IE7.  IF I uncomment out the
>> line, I get the mis-match error.
>> :
>> function addEvent( element, type, handler ) {
>> if( element.addEventListener ) {
>> element.addEventListener( type, handler, false );
>> } else {
>> //this line is commented out as it appears to cause a mis-match error in
>> IE7
>> //element.attachEvent( 'on' + type, handler );
>> }
>> }
>>
>> function myFunction1() {alert ("loaded 1")};
>> function myFunction1() {alert ("loaded 1")};
>>
>> addEvent(window, 'load', myFunction1());
>> addEvent(window, 'load', myFunction2());
>
> These last two lines are your problem.  There should be no parentheses 
> after the function names, because that executes them immediately 
> rather than passing their pointers to the addEvent function.
>
> Should be:
>
> addEvent(window, 'load', myFunction1);
> addEvent(window, 'load', myFunction2);
>
> IE was throwing the error because instead of passing a function to 
> attachEvent you were passing the result of executing your functions, 
> which is void.  Hence the type mismatch.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message