Mercurial > repos > tabletprog
comparison scripttags.js @ 123:da7f585bf626
Add debug logging for compiling scripts in the browser
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 05 Aug 2013 21:34:50 -0700 |
parents | 648659961e0e |
children |
comparison
equal
deleted
inserted
replaced
122:9820ecd4eed4 | 123:da7f585bf626 |
---|---|
21 } | 21 } |
22 | 22 |
23 onReady(function() { | 23 onReady(function() { |
24 toplevel.onReady( function() { | 24 toplevel.onReady( function() { |
25 var tags = qall('script[type="text/tabletprog"]'); | 25 var tags = qall('script[type="text/tabletprog"]'); |
26 | 26 |
27 for (var i = 0; i < tags.length; ++i) { | 27 for (var i = 0; i < tags.length; ++i) { |
28 if (tags[i].src) { | 28 if (tags[i].src) { |
29 get(tags[i].src, function(req) { | 29 (function() { |
30 compileAndRun(req.responseText); | 30 var src = tags[i].src; |
31 }); | 31 get(src, function(req) { |
32 console.log('Compiling ' + src); | |
33 compileAndRun(req.responseText); | |
34 }); | |
35 })(); | |
32 } else { | 36 } else { |
33 compileAndRun(tags[i].innerHTML); | 37 compileAndRun(tags[i].innerHTML); |
34 } | 38 } |
35 } | 39 } |
36 }); | 40 }); |