<pclass="arguement"><strong>eventType</strong>A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.</p>
<pclass="arguement"><strong>eventData</strong>A map of data that will be passed to the event handler.</p>
<pclass="arguement"><strong>handler(eventObject)</strong>A function to execute at the time the event is triggered.</p>
</li></ul>
<divclass="longdesc">
<p>This method is identical to <code>.bind()</code>, except that the handler is unbound after its first invocation. For example:</p>
<pre>$('#foo').one('click', function() {
alert('This will be displayed only once.');
});
</pre>
<p>After the code is executed, a click on the element with ID <code>foo</code> will display the alert. Subsequent clicks will do nothing. This code is equivalent to:</p>
<pre>$('#foo').bind('click', function(event) {
alert('This will be displayed only once.');
$(this).unbind(event);
});
</pre>
<p>In other words, explicitly calling <code>.unbind()</code> from within a regularly-bound handler has exactly the same effect.</p>
</div>
<h3>Examples:</h3>
<divid="entry-examples"class="entry-examples">
<divid="example-0">
<h4>Example: <spanclass="desc">Tie a one-time click to each div.</span>