Once the file has been saved, you can call it from the HTML code via the src attribute of the opening script tag, as shown below for write. Another advantage to this method is that the same script can be included in multiple pages, and editing the script file will update the script in every page that uses the external script file.
Doing this makes it far easier to edit the script as it can be done in one place rather than editing the code within the script tags on each page that contains the script.
Writing into the HTML output Writing into an HTML element Writing into an window alert box Writing into the browser console.
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.