Two problems:
The first problem is that you have extra text at the end of the script:
})();
The second problem is that you are completing function definitions inside the onDomReady function.
Change this option to no wrap(head) and it will work.
source share