Difference between revisions of "Team:Jilin China/Enc/CodeLab"

Line 7: Line 7:
 
  var n2= "";
 
  var n2= "";
 
  var n3= "";
 
  var n3= "";
var m = new Manufac();
 
 
  var usa = "";
 
  var usa = "";
 
  $("#user_item").contents().each(function(){
 
  $("#user_item").contents().each(function(){
Line 14: Line 13:
 
     }
 
     }
 
  });
 
  });
usn = m.encode(usn);
 
 
  var usn = usa.toString();
 
  var usn = usa.toString();
 +
usn = ba4uniEn(usn);
 
  //$("#a").html(usn);
 
  //$("#a").html(usn);
   
+
  alert(usn);
  if (usn == n1 || "Belle"){$("#a").html(uss);}
+
  if (usn == n1 || "Belle"){$("#a").html(ba4uniDe(uss));}
 +
}
 +
function ba4uniEn(str) {
 +
    return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
 +
        return String.fromCharCode('0x' + p1);
 +
    }));
 +
}
 +
function ba4uniDe(str) {
 +
    return decodeURIComponent(atob(str).split('').map(function(c) {
 +
        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
 +
    }).join(''));
 
}
 
}
 
</script>
 
</script>
<script src="https://2018.igem.org/wiki/index.php?title=Team:Jilin_China/Enc/CodeLibPrivate&action=raw&ctype=text/javascript"></script>
+
<!--script src="https://2018.igem.org/wiki/index.php?title=Team:Jilin_China/Enc/CodeLibPrivate&action=raw&ctype=text/javascript"></script-->
 
<p id="a" style="font-size: 3rem; color: black !important;">Text box is blank!</p>
 
<p id="a" style="font-size: 3rem; color: black !important;">Text box is blank!</p>
 
<input type="button" style="width:10rem;height:10rem;background: gray" onClick="timedMsg()"></div>
 
<input type="button" style="width:10rem;height:10rem;background: gray" onClick="timedMsg()"></div>
 
</html>
 
</html>

Revision as of 09:04, 1 September 2018

Text box is blank!