This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function random_number_increment( min, max, inc ) { | |
| let min = min || 0; | |
| let inc = inc || 1; | |
| if ( !max ) { | |
| return new Error( 'Need to define max' ); | |
| } | |
| return Math.floor( Math.random() * ( max - min ) / inc ) * inc + min; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <textarea id="text_field_to_save">Everything from here will be saved</textarea> | |
| <input type="text" id="filename_to_save_as" value="filename.txt" /> | |
| <script> | |
| function save_text_as_file () { | |
| let text_to_save = document.getElementById( 'text_field_to_save' ).value; | |
| let text_to_save_as_blob = new Blob( [ text_to_save ], { | |
| type: "text/plain" | |
| } ); |
NewerOlder