File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 3838< button onclick ="testOptions() "> test options</ button >
3939< button onclick ="throwString() "> throw string</ button >
4040< button onclick ="showDialog() "> show dialog</ button >
41+ < button onclick ="blobExample() "> blob example</ button >
4142
4243</ body >
4344</ html >
Original file line number Diff line number Diff line change @@ -46,6 +46,22 @@ function showDialog() {
4646 Raven . showReportDialog ( ) ;
4747}
4848
49+ function blobExample ( ) {
50+ var xhr = new XMLHttpRequest ( ) ;
51+ xhr . open ( 'GET' , 'stack.js' ) ;
52+ xhr . onreadystatechange = function ( ) {
53+ if ( xhr . readyState === 4 ) {
54+ var blob = new Blob ( [ xhr . responseText ] , { type : 'application/javascript' } ) ;
55+ var url = URL . createObjectURL ( blob ) ;
56+
57+ var script = document . createElement ( 'script' ) ;
58+ script . src = url ;
59+ document . head . appendChild ( script ) ;
60+ }
61+ } ;
62+ xhr . send ( ) ;
63+ }
64+
4965function a ( ) { b ( ) ; }
5066function b ( ) { c ( ) ; }
5167function c ( ) { d ( ) ; }
Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ function bar ( ) {
3+ baz ( ) ;
4+ }
5+
6+ function foo ( ) {
7+ bar ( ) ;
8+ }
9+
10+ foo ( ) ;
11+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments