Difference between revisions of "Team:Heidelberg/Sandbox19"

(Created page with "<html> <script src="http://stuk.github.io/jszip/dist/jszip.js"></script> <script src="http://stuk.github.io/jszip/vendor/FileSaver.js"></script> <script src="https://ajax....")
 
(Blanked the page)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<html>
 
<script src="http://stuk.github.io/jszip/dist/jszip.js"></script>
 
    <script src="http://stuk.github.io/jszip/vendor/FileSaver.js"></script>
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
 
<script>
 
var _create_zip_format = function(src, id) {
 
      // create zip file from src
 
      // and insert content
 
     
 
    var xhttp = new XMLHttpRequest();
 
  xhttp.onreadystatechange = function() {
 
    if (this.readyState == 4) {
 
        if(this.status == 200){
 
      response = this.responseText;
 
console.log(JSON.parse(response));
 
  
 
var weights_name = Object.keys(this.responseText);
 
 
console.log(weights_name[]);
 
for(var i=0; i<weights_name.length; i++) {
 
              var ref_to_link = response[weights_name[i]].filename;
 
              response[weights_name[i]].shape;
 
              console.log(ref_to_link);
 
/*
 
              var oReq = new XMLHttpRequest();
 
              oReq.open("GET", ref_to_link , true);
 
              oReq.responseType = "arraybuffer";
 
             
 
              oReq.onload = function(oEvent) {
 
                  console.log(oEvent);
 
                  var arraybuffer = oReq.reponse;
 
                  if(arrayBuffer) {
 
                      console.log(arraybuffer);
 
                      /*zip.file(weigths_name[i], arraybuffer);  */
 
                  }
 
 
 
 
 
 
 
 
 
              }
 
             
 
             
 
             
 
              }
 
    }
 
  xhttp.open("GET", src, true);
 
  xhttp.send();
 
}
 
   
 
 
 
    _create_zip_format('https://2017.igem.org/Team:Heidelberg/manifest_json?action=raw', 'id');
 
</script>
 
</html>
 

Latest revision as of 17:51, 14 December 2017