Infobar material design refresh: bg color
[chromium-blink-merge.git] / ppapi / examples / url_loader / url_loader.html
blob808b369479b075e3654e3cd29b7556cb4105a815
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright (c) 2011 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
8 This example just uses postMessage to tell the plugin to fetch a file.
9 The plugin will echo the contents of that file back to us and we'll display
10 it on the page.
11 -->
12 <head>
13 <title>URLLoader Example</title>
14 </head>
16 <body>
17 <script>
19 function StartRequest() {
20 var plugin = document.getElementById("plugin");
21 var inputBox = document.getElementById("inputBox");
22 plugin.postMessage("go");
25 </script>
27 <p>This test must be run over HTTP. If you're a Chrome developer, see the
28 README_chrome_developer.txt in this directory for how to run.</p>
30 <button onclick="StartRequest()">Start request</button>
31 <object id="plugin" type="application/x-ppapi-url-loader-example"
32 width="1" height="1">
33 </object>
34 <hr>
35 <div id="log_result" style="background-color:#EEE; border:1px solid black;">
36 <i>Result will go here...</i>
37 </div>
39 <script>
41 function HandleMessage(message_event) {
42 document.getElementById("log_result").textContent = message_event.data;
45 // Attach a listener for the message event. This must happen after the plugin
46 // object was created.
47 var plugin = document.getElementById("plugin");
48 plugin.addEventListener("message", HandleMessage, false);
50 </script>
51 </body>
52 </html>