All pastes #896962 Raw Edit

Unbenannt

public javascript v1 · immutable
·published 2008-02-09 02:28 UTC
rendered paste body
<script>	var iBeginCount = 10;	var toCountdown;	var btAccept;		function add()	{	btAccept = document.createElement('input');	btAccept.setAttribute('type','button');	btAccept.setAttribute('disabled','disabled');	btAccept.setAttribute('value','Akzeptieren (' + iBeginCount + ')');	document.getElementById('accept').appendChild(btAccept);	toCountdown = setTimeout('CountdownProc(' + (iBeginCount - 1) + ')',1000);	}		function CountdownProc(iCurrentCount)	{		if (iCurrentCount == 0)		{			btAccept.setAttribute('disabled','');			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>