Skip to main content

Topic: donwloader !! go back into this webbrowser !! :D (Read 339 times)

  • Quetzal
  • [*][*]
donwloader !! go back into this webbrowser !! :D
 well, ever some problem with the inner donwloader of Otter
i've made, with my own two hands, this little of coding bravoury wich permit to test some Javascript stuff...
just need to copy/paste in a new file, and rename it in .html and clic onto
=> in Otter browser
=> in chromium-like (i use Iridium browser)

and you'll see if you try, both work with webkitURL...
but not "exactly" in the same way...
both of them can donwload the textarea result but, but, but...

Code: [Select]
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<script type='text/javascript'>
//#========== JSeror =================
function JSeror(){document.getElementById('AAA').style.background = 'lightgrey'; }
//#===================================
//#===================================
function myDL(){
var data = document.getElementById('txta').value;
var blo = new Blob([data], {type:'text/plain'});

if (window.webkitURL != null)
{ document.getElementById('ank').href = window.webkitURL.createObjectURL(blo);
document.getElementById('AAA').style.border = "solid 3px red";
document.getElementById('show').innerHTML = "webkit";}

else { document.getElementById('ank').href = window.URL.createObjectURL(blo);
document.getElementById('AAA').style.border = "solid 3px blue";
document.getElementById('show').innerHTML = "all other";}
document.getElementById('ank').click(); }

function TESTJS(){ myDL(); }

 
</script>
</head>
<body onload="JSeror();">

<div id="AAA" style="float:left; width:400px; border:solid 1px black; background:red;">
<input type="button" onclick="TESTJS();" value="TESTJS" style="float:left; width:100px;"></input>
<a href="" id="ank" download="kinit.txt" style="display:block;">donwload me if you can !</a>
<div id="show" style="float:left; background:white; border-top:solid 1px black; min-width:400px; min-height:100px"></div>
</div><br><br>

<textarea id="txta" value="write something be there" style="display:block; background:lightgrey; margin-top:150px; width:400px; height:300px; border:solid 1px red; "></textarea>


</div>
</body>
</html>

have a nice day ;)