Grabbing search value from input on popup

why not use a self-calling function instead of using an anonymous function in jquery
(function(){
...
})();