All pastes #896970 Raw Edit

Unbenannt

public javascript v1 · immutable
·published 2008-02-09 02:37 UTC
rendered paste body
<script>	var iBeginCount = 2;	var toCountdown;	var btAccept;		function add()	{		btAccept = document.createElement('input');		btAccept.setAttribute('type','button');		btAccept.disabled=true;		btAccept.setAttribute('value','Akzeptieren (' + iBeginCount + ')');		document.getElementById('accept').appendChild(btAccept);		toCountdown = setTimeout('CountdownProc(' + (iBeginCount - 1) + ')',1000);	}		function CountdownProc(iCurrentCount)	{		if (iCurrentCount == 0)		{			btAccept.disabled=false;			btAccept.setAttribute('value','Akzeptieren');			if (btAccept.addEventListener)  // the DOM2, W3C way         		       btAccept.addEventListener("click", AcceptProc, false);			else if (btAccept.attachEvent)  // the IE way                		btAccept.attachEvent("onclick", AcceptProc);			clearTimeout(toCountdown);		}		else		{			btAccept.setAttribute('value','Akzeptieren (' + iCurrentCount + ')');			toCountdown = setTimeout('CountdownProc(' + (iCurrentCount - 1) + ')',1000);		}	}		function AcceptProc()	{		alert("usw...");	}</script><div id="accept"><a href="javascript:add();">das</a> | </div>