as far as I know I can send data to another page but I don't know how...I don't want to use frameworks or libraries like jQuery. I just want to use Javascript, HTML5 and CSS3.
Here is my code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" lang="es-es">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/menu.css" type="text/css" media="screen">
<title>Read and Parse Lynis Log</title>
<script>
function processFiles(files) {
var file = files[0];
var reader = new FileReader();
var textParsed = [];
reader.onload = function (e) {
var output = document.getElementById("fileOutput");
output.textContent = e.target.result;
var text = e.target.result;
var lines = text.split("\n");
for (i=0; i<lines.length; i++) {
textParsed[i] = lines[i];
console.log(textParsed[i]);
}
};
reader.readAsText(file);
}
</script>
</head>
<body>
<input id="fileInput" placeholder=":input" type="file" size="50" onchange="processFiles(this.files)">
<div id="fileOutput"></div>
<div class="container">
<ul id="nav">
<li><a href="#"><img src="images/t1.png" /> Dashboard</a></li>
<li><a href="#" class="sub" tabindex="1"><img src="images/t2.png" />Reporting</a><img src="images/up.gif" alt="" />
<ul>
<li><a href="#"><img src="images/empty.gif" />LYNIS LOG</a></li>
<li><a href="#"><img src="images/empty.gif" />LYNIS REPORT</a></li>
</ul>
</li>
<li><a href="#" class="sub" tabindex="1"><img src="images/t3.png" />Lynis Tests</a><img src="images/up.gif" alt="" />
<ul>
<li><a href="#"><img src="images/empty.gif" />Accounting</a></li>
<li><a href="#"><img src="images/empty.gif" />Authentication</a></li>
<li><a href="#"><img src="images/empty.gif" />Banner</a></li>
<li><a href="#"><img src="images/empty.gif" />Boot</a></li>
<li><a href="#"><img src="images/empty.gif" />Crypto</a></li>
<li><a href="#"><img src="images/empty.gif" />File Integrity</a></li>
<li><a href="#"><img src="images/empty.gif" />Firewall</a></li>
<li><a href="#"><img src="images/empty.gif" />Hardening</a></li>
<li><a href="#"><img src="images/empty.gif" />Kernel</a></li>
<li><a href="#"><img src="images/empty.gif" />Logging</a></li>
<li><a href="#"><img src="images/empty.gif" />Mail</a></li>
<li><a href="#"><img src="images/empty.gif" />Malware</a></li>
<li><a href="#"><img src="images/empty.gif" />Nameservers</a></li>
<li><a href="#"><img src="images/empty.gif" />Networking</a></li>
<li><a href="#"><img src="images/empty.gif" />PHP</a></li>
<li><a href="#"><img src="images/empty.gif" />Printing</a></li>
<li><a href="#"><img src="images/empty.gif" />Processes</a></li>
<li><a href="#"><img src="images/empty.gif" />Shell</a></li>
<li><a href="#"><img src="images/empty.gif" />Software</a></li>
<li><a href="#"><img src="images/empty.gif" />Squid</a></li>
<li><a href="#"><img src="images/empty.gif" />SSH</a></li>
<li><a href="#"><img src="images/empty.gif" />Storage</a></li>
<li><a href="#"><img src="images/empty.gif" />Time</a></li>
<li><a href="#"><img src="images/empty.gif" />Tooling</a></li>
<li><a href="#"><img src="images/empty.gif" />Web</a></li>
</ul>
</li>
<li><a href="#"><img src="images/t2.png" />Overview</a></li>
</ul>
</div>
</body>
</html>
You can see more details about the code in the following fiddle
As you can see, when the user selects a text file, the content is stored in the array: var textParsed = [];
Then, my question is: if I want to send the array to another page in the menu and use it again as a variable, for example: var textParsed2
, how can I do it? The communication must be client-side!