Hi,

I'm a little confused by this code in index.html:
```
canvas: (function() {

        var canvas = document.getElementById('canvas');
        canvas.addEventListener("webglcontextlost", function(e) { 
alert('WebGL context lost. You will need to reload the page.'); 
e.preventDefault(); }, false);

        return canvas;
    })(),
```
What's the deal with the weird `(function(){...})();` syntax? Other 
functions in index.html don't seem to do this.

Is it something to do with only running the function code once? Otherwise 
it seems like a weglcontextlost listener would be added each time canvas() 
was called!

Bye,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/4eba3c20-36f2-4a19-b8a6-b1e90c14cde7n%40googlegroups.com.

Reply via email to