Article 6KES5 JavaScript GUI For shelp.sh - Reading a File in JavaScript, Displayed on Linux Client

JavaScript GUI For shelp.sh - Reading a File in JavaScript, Displayed on Linux Client

by
des_a
from LinuxQuestions.org on (#6KES5)
Here is my code:

Code:<HTML>
<HEAD>
<TITLE>Help Displayer</TITLE>
<SCRIPT LANGUAGE="javaScript">
<!-- Hide javascript
function help(topic, subtopic)
{
const path = "/etc/settings/shelp/"
const fr = new FileReader(path + topic + "/" + subtopic)
fileReader.onload = function(event)
{
alert(fileReader.result)
}
inputElement.onchange = function(event)
{
fileReader.readAsText(event.target.files[0])
}
}
-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="green">
<FONT COLOR="blue"><H1 ALIGN="center">Help Displayer</H1>
<FORM>
Help on which topic? <B>TOPIC</B>&nbsp;<INPUT NAME="subject1" TYPE="text">&nbsp;&nbsp;<B>SUBTOPIC</B>&nbsp;<INPUT NAME="subject2" TYPE="text"><BR>
<BR>
<INPUT NAME="submit" TYPE="button" VALUE="Help" onClick="help(this.subject1.value, this.subject2.value)"><BR>
<BR>
<INPUT NAME="reset" TYPE="reset">
</FORM>
</FONT>
</BODY>
</HTML>I'm trying to create a GUI for my shelp.sh standard script command. Needing to use javascript in an HTML page, is part of my rules of my challenge right now, if I'm going to do it now. I don't want to have to install a server in order to do this. This does nothing on click of the help button. Please help me write the file out as an alert. If it's very, very simple, I'm ok with using other languages as well, as long as JavaScript and HTML integrates it together, and I understand what I'm doing. I will tie it in with the shell scripts, AFTER this works. Please help me. When I finish this, it will be used on my network, and shared via github a few different ways.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments