Javascript examples for Statement:try catch finally
Try catch { call function }
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from w w w . j a va2 s . c o m*/ function setGrid() { console.log('inside setGrid'); } try { Typekit.load({ loading: function() { }, active: function() { setGrid(); }, inactive: function() { } }) } catch(e) { console.log('error') //works setGrid(); //doesn't get called } }); </script> </head> <body> </body> </html>