Search and Top Navigation
#12520 closed bug (notabug)
Opened May 08, 2015 08:31PM UTC
Closed May 08, 2015 08:42PM UTC
Last modified May 08, 2015 08:42PM UTC
click.apply is not a function
| Reported by: | Backslider | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | none |
| Component: | ui.dialog | Version: | 1.11.3 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
I have a simple dialog:
<div id="shippingAddressDialog">
<p>Would you like to add a separate shipping address?</p>
</div>
$(document).ready(function() {
jQuery('#shippingAddressDialog').dialog({"modal":true,"autoOpen":true,"title":"Shipping Address","width":"400px","buttons":[{"text":"Yes","click":"function(){closeDialog();}"}]});
});
function closeDialog() {
jQuery('#shippingAddressDialog').dialog("close");
}
When the button is clicked it throws the following error (Firebug):
TypeError: click.apply is not a function
click.apply( that.element[ 0 ], arguments );
jsfiddle: https://jsfiddle.net/a8a46s2y/4/
Browser: Firefox 37.0.2
That's because it's not a function, it's a string. Remove the quotes so that
clickis actually a function.