1

JavaScript code I am trying to get to call from the HTML.

var ClassList = new Array ["Bio1300","csci12"];

function ClassMenu(ClassList) {
  return (ClassList.toString);
};

This is the HTML code I am trying to call the JavaScript function inside of on the load of the page.

<li>
  <script type="text/javascript" src="JavaScript InProg.js">
    function ClassMenu() {
      console.log(ClassList.toString);
    }
  </script>
</li>

Please help. I have many other functions I am trying to call in this manner that are both arrays and contain mathematical calculations.

Obsidian Age
  • 36,816
  • 9
  • 39
  • 58
A. Day
  • 11
  • 1
  • 4
    You appear to be attempting to execute your second JavaScript code from within an `
  • ` tag. Are you sure you're not actually intending to run it from within the `` section (where an `
  • ` would be invalid markup)? You also cannot load an external script and run inline JavaScript within the same `
  • – Obsidian Age Jul 25 '17 at 22:41
  • 1
    code inside ` – dandavis Jul 25 '17 at 22:46
  • It was my understanding that you could put a script tag anywhere in the HTML and that it was supposed to be put where you wanted the script from JS to run. Yes, my ClassMenu function is in the JavaScript InProg.js file. I'm not sure I understand what you mean by "You also cannot load an external script and run inline JavaScript within the same – A. Day Jul 25 '17 at 22:49