1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <!-- $Id: base64.html,v 1.1 2009/03/01 22:00:28 dankogai Exp dankogai $ -->
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <title>Test for base64.js</title>
9 <h1>Test for base64.js</h1>
10 <p>$Id: base64.html,v 1.1 2009/03/01 22:00:28 dankogai Exp dankogai $</p>
11 <table width="640"><tbody>
12 <tr><th width="50%">Text</th><th>Base64
13 (URL Safe <input id="encodeURI" type="checkbox" onclick="doit()">)</th></tr>
15 <th><textarea id="srctxt" cols="32" rows="4" onkeyup="doit()">
17 <th><textarea id="base64" cols=32" rows="4" onkeyup="
18 $('srctxt').value = Base64.decode(this.value);
20 if (1 /*@cc_on -1 @*/) $('data').src = 'data:text/plain;base64,' + this.value;
23 <tr><th width="50%">Roundtrip</th><th>iframe w/ data: (no IE)</th></tr>
25 <th><textarea id="roundtrip" cols=32" rows="4" disabled></textarea></th>
26 <th><iframe id="data" width="80%" height="64"></iframe></th>
31 <script src="./base64.js"></script>
33 $ = function(id){ return document.getElementById(id) };
36 'encode' + ($('encodeURI').checked ? 'URI' : '')
38 $('base64').value = encoded;
39 if (1 /*@cc_on -1 @*/) {
40 $('data').src = 'data:text/plain;base64,'
41 + Base64.encode(Base64.decode(encoded));
43 $('roundtrip').value = Base64.decode(encoded);