I can't figure out what's wrong here and I'm not getting any output from the Javascript file. I am trying to use src to be able to type my javascript file outside of the index file. This just prints the header from the html file A test heading without printing the text variable. If I type the code within the html file it works fine. Both scripts are in the same folder.
<!DOCTYPE HTML>
<html>
<head>
<h2>
A Test Heading
</h2>
<script language = JavaScript src=/slider.js></script>
</head>
</html>
Here's the file labeled slider.js -
function slider(){
var text = Welcome to Slider Simulator 2013!;
document.write(text);
}
slider();