| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // A JS interop sample showing JSONP access to Twitter from Dart. | 5 // A JS interop sample showing JSONP access to Twitter from Dart. |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'package:js/js.dart' as js; | 8 import 'package:js/js.dart' as js; |
| 9 | 9 |
| 10 void main() { | 10 void main() { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 for (int i = 0; i < length; ++i) { | 43 for (int i = 0; i < length; ++i) { |
| 44 var result = results[i]; | 44 var result = results[i]; |
| 45 String user = result.from_user_name; | 45 String user = result.from_user_name; |
| 46 String text = linkify(result.text); | 46 String text = linkify(result.text); |
| 47 | 47 |
| 48 var div = new DivElement() | 48 var div = new DivElement() |
| 49 ..innerHtml = '<div>From: $user</div><div>$text</div><p>'; | 49 ..innerHtml = '<div>From: $user</div><div>$text</div><p>'; |
| 50 document.body.nodes.add(div); | 50 document.body.nodes.add(div); |
| 51 } | 51 } |
| 52 } | 52 } |
| OLD | NEW |