OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2009 Google Inc. |
| 3 |
| 4 Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 you may not use this file except in compliance with the License. |
| 6 You may obtain a copy of the License at |
| 7 |
| 8 http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
| 10 Unless required by applicable law or agreed to in writing, software |
| 11 distributed under the License is distributed on an "AS IS" BASIS, |
| 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 See the License for the specific language governing permissions and |
| 14 limitations under the License. |
| 15 |
| 16 |
| 17 This file demonstrates how to use the generated Complex plug-in. |
| 18 --> |
| 19 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 20 "http://www.w3.org/TR/html4/loose.dtd"> |
| 21 <html> |
| 22 <head> |
| 23 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 24 <title> |
| 25 WTF sample. |
| 26 </title> |
| 27 <script> |
| 28 |
| 29 /** |
| 30 * Logs text into the <pre> tag. |
| 31 */ |
| 32 function log(text) { |
| 33 var div = document.getElementById('output'); |
| 34 div.innerHTML += text + '\n'; |
| 35 } |
| 36 |
| 37 function init() { |
| 38 window.alert('hello'); |
| 39 log("getting plugin"); |
| 40 var plugin = document.getElementById('plugin'); |
| 41 var wtf = plugin.WTF(); |
| 42 |
| 43 window.alert('Initializing.'); |
| 44 log("Initialize"); |
| 45 wtf.Initialize("/usr/local/google/home/jcarollo/chrome4/src/out/Debug"); |
| 46 window.alert('Initialized.'); |
| 47 log("NavigateToURL"); |
| 48 wtf.NavigateToURL("http://www.test.com"); |
| 49 log("Done"); |
| 50 } |
| 51 |
| 52 </script> |
| 53 </head> |
| 54 <body> |
| 55 <pre id='output'></pre> |
| 56 <object type='application/wtf' id='plugin' width='0' height='0'> </object> |
| 57 <input type='button' value='Init' id='init_button' onclick='init();'/> |
| 58 </body> |
| 59 </html> |
OLD | NEW |