title: Javascript Questions on the function - IIFE
body: <p>I was asked to ask another question and link it to this thread.
  <a href="https://stackoverflow.com/questions/30193659/how-add-mandatory-dropdown-field-in-touch-ui/37041445?noredirect=1#comment61636750_37041445">How add mandatory dropdown field in Touch UI</a></p>
  
  <p>My question is what: 
  can somebody tell me what is the end line of the javascript function is doing.</p>
  
  <pre><code>})(document, Granite.$, Granite.author); 
  </code></pre>
  
  <p>is it some kind of namespacing.</p>
  
  <p>For your reference i am attaching the Javascript code.</p>
  
  <pre><code>(function (document, $, ns) {
      "use strict";
  
      $(document).on("click", ".cq-dialog-submit", function (e) {
          e.stopPropagation();
          e.preventDefault();
  
          var $form = $(this).closest("form.foundation-form"),
              title = $form.find("[name='authoringMode']").val(),
              message, clazz = "coral-Button ";
  
          if(!title){
              ns.ui.helpers.prompt({
              title: Granite.I18n.get("Invalid Input"),
              message: "Please Check Values",
                  actions: [{
                      id: "CANCEL",
                      text: "CANCEL",
                      className: "coral-Button"
                  }
              ],
              callback: function (actionId) {
                  if (actionId === "CANCEL") {
                  }
              }
          });
          }else{
                   $form.submit();
          }
      });
  })(document, Granite.$, Granite.author);
  </code></pre>