javascript, ASP.NET AJAX, , .
onclick:
- , onclick
closureId,setTimeout (5000 = 5 )closureId
HTML, test.html, :
< input id = "btnTest" type = "button" value = "test" onclick = "var closId = this.id; this.disabled = true; setTimeout (function() {document.getElementById( closedId).disabled = false;}, 5000); >
, , submit - . , , , - . , .
. closureId "", , -
, this.id , this -, DOM.
I could not find another way to get a link to the source event (this.this.id does not work), but lexical coverage somehow allows me to access the closId variable, as it was determined at the time of the initial button click.
Feel free to correct / comment if you know the best way!
source
share