How to Move a Script Code Into a JS File

104 28
    • 1). Open the text editor program, and create a new file. Name the file "Test.js" and save it.

    • 2). Open the text file containing the Javascript code, within your text editor program. Find the lines where the script is located -- normally enclosed between "<script>" and "</script>" tags. Using the mouse, highlight the script, and press "CTRL" + "C" to copy it.

    • 3). Open the "Test.js" file saved earlier. Press "CTRL" + "V" to paste the script into the file. Ensure that the "<script>" and "</script>" tags are not present in the file, and then save it. The script can now be executed from within HTML Web pages using the following lines:
      <script>
      language="javascript" src="Test.js">
      </script>

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.