using custom options in jquery UI dialog
I've noticed what I'd call a bug when using custom properties in the jquery UI dialog plugin:
If I do something like
- $(function() {
- $('#dialog').dialog({test: 'OK'});
- alert($('#dialog').dialog('option','test');
- });
all works fine and I get an alert with "OK" written in it. However if I do something like
- $(function() {
- $('#dialog').dialog({test: 'OK'});
- alert($('#dialog').dialog('option','non_existent');
- });
the alert contains "[object Object]", and upon further tests it seems that searching for a non existen option simply returns the whole object, which in my opinion is quite wrong, it should return something like null or undefined.
Am I doing something wrong or there is really a problem here?