Wednesday 30 December 2015

FILE SAVE AS WITH JAVA SCRIPT METHOD CODE


-----------------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN POST HTML SECTION
READ MORE:
https://www.willpeavy.com/minifier/
-----------------------------------------------------------------------------------------------------------------

<!DOCTYPE html>
<!-- http://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server -->
<html>
<title>Save As Text Or Html In Java </title>
<head>
<style>
form * {
width:100%;
border: 2px Red solid;
}
#TextFile{
display: block;
background:repeating-linear-gradient(45deg, #606DBC, #606DBC 10px, #465298 10px, #465298 20px);
color:Red;
font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
font-size:18px;
padding:3px 0;
border: 2px Blue solid;
margin:0px;
width:500px;
}
#DownloadButton {
background:green;
border:4px solid yellow;
border-radius:4px;
outline:blue solid 5px;
margin:8px;
clear:both;
color:#FFFFFF;
cursor:pointer;
display:inline-block;
font-family:'Times New Roman', Georgia, serif;
font-size:20px;
width:200px;
text-transform: uppercase;
cursor:pointer;
}
#OutPutFile{
display: block;
height:100%;
margin:4px;
width:500px;
height:500px;
border:5px double yellow;
outline:blue solid 5px;
}
</style>
<script type='text/javascript'>
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
</script>
</head>
<body>

<form onsubmit="download(this['name'].value,this['text'].value)">
<input type="text" name="name"id="TextFile"value="FbGadgets.txt">
<input type="submit"value="Download"id="DownloadButton">
<textarea name="text"id="OutPutFile">
1)ENTER YOUR TEXT BY PASTE OR RIGTH HERE AND CLICK THE "DOWNLOAD BUTTON ABOVE.
2)YOU CAN SAVE YOUR TEXT AS TEXT,CSS,HTML
3)YOU NEED TO REMOVE FbGadgets.txt AND TYPE INPUT BOX "FbGadgets.css", "FbGadgets.html"
</textarea>
</form>
</body>
</html>

1 comments:

  1. To minify HTML, you can use the following link
    url-decode.com/tool/minifyhtml
    the landing page also contains dozens of other online web tools for the users as well.

    ReplyDelete

FB Gadgets | Template Designed by Fatakat PhotosCoolBThemes.com
Code by : paid web directory

https://www.google.co.uk/search?q=site%3Ablogspot.com+fbgadgets