Skip to main content

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

Attachments (0)
Change History (2)

Changed May 08, 2015 08:42PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

That's because it's not a function, it's a string. Remove the quotes so that click is actually a function.

Changed May 08, 2015 08:42PM UTC by scottgonzalez comment:2

component: ui.coreui.dialog