I am trying to understand some of the source code behind Google AdSense. Google's code generator (here) says to put the following in the HEAD element:
<script type="text/javascript" charset="utf-8">
(
function(G,o,O,g,L,e) {
G[g]=G[g] || function(){(G[g]['q']=G[g]['q'] || []).push(arguments)},
G[g]['t']=1*new Date;
L=o.createElement(O), e=o.getElementsByTagName(O)[0];
L.async=1;
L.src='//www.google.com/adsense/search/async-ads.js';
e.parentNode.insertBefore(L,e) /* no semicolon...why? */
}
)(window,document,'script','_googCsa'); /* argument list */
</script>
My knowledge of JS syntax is not very good, and I don't know answers to the following:
(1) A function inside a set of parentheses, and then what looks like an argument list,
(2) No semicolon after the last line in the curly braces...what's going on here?
(3) What is function(GoOgLe) actually doing? (I tried Googling "function(G,o,O,g,L,e)", but only got others' source code.)
Any help would be appreciated.