File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 38
38
< button onclick ="testOptions() "> test options</ button >
39
39
< button onclick ="throwString() "> throw string</ button >
40
40
< button onclick ="showDialog() "> show dialog</ button >
41
+ < button onclick ="blobExample() "> blob example</ button >
41
42
42
43
</ body >
43
44
</ html >
Original file line number Diff line number Diff line change @@ -46,6 +46,22 @@ function showDialog() {
46
46
Raven . showReportDialog ( ) ;
47
47
}
48
48
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
+
49
65
function a ( ) { b ( ) ; }
50
66
function b ( ) { c ( ) ; }
51
67
function 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