Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: ppapi/examples/url_loader/url_loader.html

Issue 7330027: Add an example for using the URLLoader in streaming mode. This also avoids the (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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.
7
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 <script>
15
16 function HandleMessage(message_event) {
17 document.getElementById("log_result").innerHTML = message_event.data;
18 }
19
20 function AddListener() {
21 var plugin = document.getElementById("plugin");
22 plugin.addEventListener("message", HandleMessage, false);
23 }
24 document.addEventListener("DOMContentLoaded", AddListener, false);
darin (slow to review) 2011/07/09 04:01:27 note: you could also just put this <script> block
25
26 </script>
27 </head>
28
29 <body>
30 <script>
31
32 function StartRequest() {
33 var plugin = document.getElementById("plugin");
34 var inputBox = document.getElementById("inputBox");
35 plugin.postMessage("go");
36 }
37
38 </script>
39
40 <p>This test must be run over HTTP. If you're a Chrome developer, see the
41 README_chrome_developer.txt in this directory for how to run.</p>
42
43 <button onclick="StartRequest()">Start request</button>
44 <object id="plugin" type="application/x-ppapi-url-loader-example"
45 width="1" height="1">
46 </object>
47 <hr>
48 <div id="log_result" style="background-color:#EEE; border:1px solid black;">
49 <i>Result will go here...</i>
50 </div>
51 </body>
52 </html>
53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698