Team:Heidelberg/Templates/Awesomesheet
From 2014.igem.org
(Difference between revisions)
m |
m |
||
Line 5: | Line 5: | ||
} | } | ||
</style> | </style> | ||
+ | <script type='text/javascript'> | ||
+ | var _load_unzip_format_and_insert = function(src, id) { | ||
+ | // load zip file from src, unzip and format it to text | ||
+ | // and insert content into DOM element referenced by id | ||
+ | var file = src; //"PlateReader.zip"; //"https://2014.igem.org/File:Team_Heidelberg_Awesomesheet_Growth.zip"; | ||
+ | var oReq = new XMLHttpRequest(); | ||
+ | oReq.open("GET", file, true); | ||
+ | oReq.responseType = "arraybuffer"; | ||
+ | |||
+ | oReq.onload = function (oEvent) { | ||
+ | var arrayBuffer = oReq.response; // Note: not oReq.responseText | ||
+ | if (arrayBuffer) { | ||
+ | var byteArray = new Uint8Array(arrayBuffer); | ||
+ | var gunzip = new Zlib.Gunzip(byteArray); | ||
+ | var plain = gunzip.decompress(); | ||
+ | var filltext = String.fromCharCode.apply(null, plain); | ||
+ | $(id).append(filltext); | ||
+ | } | ||
+ | }; | ||
+ | oReq.send(); | ||
+ | }; | ||
+ | |||
+ | //_load_unzip_format_and_insert("PlateReader.zip", ".notebook-awesomesheet"); | ||
+ | </script> | ||
</html> | </html> |
Revision as of 19:45, 17 October 2014