I got a simple UI widget and i'd like it to alert() the "hello world!!!" when initialised.
$.widget("ui.myWidget", {
_init: function() {
//start
alert('Hello World!!!');
}
}
could some one explain how this init or _init function works.?
if i was to call the ui just like the dialog ui would $('#selector').dialog()
in other words if a click <div onclick="$('#id').myWidget()">Click Me</div>
then i should get the alert to pop up.
this code is short because i didnt want to put a lot of coding into it so its easy to read. thanks