Script esterno Javascript





https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto_external


<!DOCTYPE html>
<html>
<body>

<h2>External JavaScript</h2>

<p id="demo">A Paragraph.</p>

<button type="button" onclick="myFunction()">Try it</button>

<p>(myFunction is stored in an external file called "myScript.js")</p>

<script src="myScript.js"></script>

</body>
</html>


' oppure da rintracciare in un URL

https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto_url

<!DOCTYPE html>
<html>
<body>

<h2>External JavaScript</h2>

<p id="demo">A Paragraph.</p>

<button type="button" onclick="myFunction()">Try it</button>

<p>(myFunction is stored in an external file called "myScript.js")</p>

https://www.w3schools.com/js/myScript.js"></script>

</body>
</html>



' o in una subdirectory

https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto_url_relative


<!DOCTYPE html>
<html>
<body>

<h2>External JavaScript</h2>

<p id="demo">A Paragraph.</p>

<button type="button" onclick="myFunction()">Try it</button>

<p>(myFunction is stored in an external file called "myScript.js")</p>

<script src="/js/myScript.js"></script>

</body>
</html>










( scriptesternojavascript.html )- by Paolo Puglisi - Modifica del 17/12/2023