/[suikacvs]/www/test/dom/url/createobjecturl-1.html
Suika

Contents of /www/test/dom/url/createobjecturl-1.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Mon Sep 19 11:21:53 2011 UTC (13 years, 7 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/html
New tests

1 wakaba 1.1 <!DOCTYPE HTML>
2     <title>window.URL.createObjectURL</title>
3    
4     <p><label>Select a file: <input type=file></label>
5    
6     <p><input type=button onclick=exec() value="Then push this button">
7    
8     <p id=value>...
9     <dl></dl>
10    
11     <script>
12     function exec () {
13     var results = document.getElementsByTagName ('dl')[0];
14    
15     var u = window.URL || window.webkitURL || {};
16     if (u.createObjectURL) {
17     var url = u.createObjectURL (document.getElementsByTagName ('input')[0].files[0]);
18     document.getElementById ('value').firstChild.data = url;
19     } else {
20     var url = {};
21     }
22    
23     for (var v in url) {
24     var dt = document.createElement ('dt');
25     var code = document.createElement ('code');
26     code.appendChild (document.createTextNode (v));
27     dt.appendChild (code);
28     results.appendChild (dt);
29    
30     var dd = document.createElement ('dd');
31     var code = document.createElement ('code');
32     code.appendChild (document.createTextNode (url[v]));
33     dd.appendChild (code);
34     results.appendChild (dd);
35    
36     var dd = document.createElement ('dd');
37     var code = document.createElement ('code');
38     code.appendChild (document.createTextNode (Object.prototype.toString.apply (url[v])));
39     dd.appendChild (code);
40     results.appendChild (dd);
41     }
42     } // exec
43     </script>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24  
Google Analytics is used in this page; Cookies are used. 忍者AdMax is used in this page; Cookies are used. Privacy policy.