[TYPO3-dev] JSeventFuncCalls calls onLoad event twice for Opera

Cyprian Kowalczyk cyprian at pi2.pl
Fri May 5 19:49:34 CEST 2006


On Fri, 05 May 2006 18:30:57 +0200, Christopher <bedlamhotel at gmail.com>  
wrote:

> What do you mean TYPO3 sets it twice? Are you saying it appears twice
> in the source? If so, how can this be specific to ONE browser?

Here is the code:

<script type="text/javascript">
	/*<![CDATA[*/
	function T3_onloadWrapper()	{	myFunc();	}
	document.onload=T3_onloadWrapper;
	/*]]>*/
</script>

<body onload="T3_onloadWrapper();">

T3_onloadWrapper() is set to be called twice in Opera.

I thinks that'd solve the problem:

<script type="text/javascript">
	/*<![CDATA[*/
       var T3_onloadWrapperOnLoaded = false;
	function T3_onloadWrapper()	{ if (!T3_onloadWrapperOnLoaded) { myFunc();  
[...;] T3_onloadWrapperOnLoaded = true; } }
	document.onload=T3_onloadWrapper;
	/*]]>*/
</script>
<body onload="T3_onloadWrapper();">


-- 

regards, Cyprian
http://pi2.pl ~ π^2 design project

TYPO3 4.0 @ MAMP1.1 [Apache/2.0.54 (Unix) + PHP/5.0.4 DAV/2  
+ MySQL/4.1.12] @ MacOS X 10.4




More information about the TYPO3-dev mailing list