javascript run external javascript
<html>
<head>
<script src="example.js"></script><!-- include java script-->
</head>
<body>
<script type="text/javascript">
fxf();
</script>
</body>
</html>
call external
file : example.js
function fxf(){
document.write("Hello World");
}
Internal Program
<html>
<head>
<script type="text/javascript">
function displaymessage()
{
alert("Hello World!")
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" onclick="displaymessage()" >
</form>
</body>
</html>
沒有留言:
張貼留言