Daniel Ohanessian Daniel Ohanessian - 1 year ago 63
HTML Question

How to implement GitHub code into my website

I'm having issues adding my JS code from GitHub to my site. This is the code I'm trying to add on my site. I tried doing this:

<script language="javascript" src="https://raw.githubusercontent.com/InfinityRunner/TMOAC/master/Login-Code.js"></script>

But it did not work.

Answer Source

HTML5 uses <script src="javascript.js"></script the <script language="javascript"is deprecated. Copy the javascript code to notepad and save it as javascript.js and upload that file separately.

External JavaScript Advantages

Placing JavaScripts in external files has some advantages:

  • It separates HTML and code
  • It makes HTML and JavaScript easier to read and maintain
  • Cached JavaScript files can speed up page loads