Guest User

Untitled

a guest
Aug 25th, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5.   <title> CSV demo</title>
  6.  
  7.  
  8. <script type='text/javascript'>//<![CDATA[
  9. window.onload=function(){
  10. var a = document.body.appendChild(
  11.        document.createElement("a")
  12.    );
  13. a.download = "export.csv";
  14. a.href = "data:text/csv;charset=utf-8," + document.getElementById("csv").innerHTML;
  15. a.innerHTML = "[Export conent]";
  16.  
  17. }//]]>
  18.  
  19. </script>
  20.  
  21. </head>
  22. <body>
  23.   <div id="content">
  24.     <h1>Hello world</h1>
  25.     <i>Hi everybody</i>
  26. </div>
  27.  
  28. <pre id="csv" style="display:none">Year,Annual mean,5 year mean
  29. 1880,-0.31,
  30. 1881,-0.22,
  31. 1882,-0.28,-0.29
  32. 1883,-0.3,-0.29
  33. 1884,-0.33,-0.3
  34. 1885,-0.32,-0.32
  35. 1886,-0.29,-0.32
  36. 1887,-0.35,-0.28
  37. 1888,-0.28,-0.3
  38. 1889,-0.18,-0.3
  39. 1890,-0.4,-0.3
  40. 1891,-0.29,-0.31
  41. 1892,-0.33,-0.34
  42. 1893,-0.34,-0.32
  43. 1894,-0.35,-0.3
  44. 1895,-0.27,-0.26
  45. 1896,-0.19,-0.26
  46. 1897,-0.16,-0.22
  47. 1898,-0.3,-0.19
  48. 1899,-0.19,-0.19
  49. </pre>
  50.  
  51.  
  52. </body>
  53.  
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment