Anyone can please help in this. I need to assign a path for a text file in a variable to be shown later on in html here's my code:
<html>
<head>
</head>
<body>
<!-- Header -->
<header>
</header>
<!-- End Header -->
<!-- Main -->
<section id="main">
<script type="text/javascript">
var reader = new FileReader();
function readText(that){
if(that.files && that.files[0]){
var reader = new FileReader();
reader.onload = function (e) {
var output='myFile.txt'; // Here's the variable I want to assign my path in
document.getElementById('text').innerHTML= output;
};//end onload()
reader.readAsText(that.files[0]);
}
</script>
<!-- Cols -->
<div class="cols">
<h2>Contact Us</h2>
<!-- Col -->
<div id="text"></div>
<!-- End Col -->
<!-- End Cols -->
</div>
</section>
<!-- End Main -->
</body>
</html>
mousa.khaleel13 0 Newbie Poster
gon1387 22 Newbie Poster
radhakrishna.p 29 Posting Whiz in Training
gon1387 22 Newbie Poster
mousa.khaleel13 0 Newbie Poster
AleMonteiro 238 Can I pick my title?
mousa.khaleel13 0 Newbie Poster
AleMonteiro 238 Can I pick my title?
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.