Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- textarea#MyContent(name='content', placeholder='Your text goes here.', rows='10', cols='50')
- button#createSpool Create Spool-File
- // Create Job file
- function createFile() {
- var fs = require('fs');
- var filepath = "temp/JCL.txt";
- var fileContent = document.getElementById("MyContent").value;
- var filesuccess = document.getElementById("filesuccess");
- var subBut = document.getElementById("subBut");
- //Check if textarea contains content
- if (fileContent == '') {
- filesuccess.style.color = "#ff9800";
- filesuccess.innerHTML = "Please write a Job first.";
- } else if (fileContent != '') {
- // if it does, create textfile
- fs.writeFile(filepath, fileContent, (err) => {
- if (err) throw err;
- //output as success or "create a job first"
- filesuccess.style.color = "#00e676";
- filesuccess.innerHTML = "Your Job has been created. Submit now to the JES-Spool.";
- subBut.style.display = "block";
- });
- }
- };
Add Comment
Please, Sign In to add comment