How to put HTML pages Javasript



Javascript can be placed at the head or the body but in the following example, I place in the body. Javascript separated using
<script language="javascript"> javascript program written disisni </ script> or by
<script type="text/javascript"> javascript program written disisni </ script>
Here is an example program:

<html>
<body>
<script type="text/javascript">
document.write ("Hello World!");
</ script>
</ body>
</ html>





Some browsers do not support that Javascript then it will display on the page as a blank page. To anticipate javascript browsers that do not support that, then it should disispkan HTML comment tags to hide Javascript.

Just add <HTML comment tags - before the first JavaScript statement, and!
end-of-comment tag -> after the last JavaScript statement, like this:
<html>
<body>
<script type="text/javascript">
<! -
document.write ("Hello World!");
/ / ->
</ Script>
</ Body>
</ Html>

Two forward slashes at the end of line comments (/ /) consists JavaScript is
comment symbol. This prevents JavaScript from executing the - tag>.

0 Response to "How to put HTML pages Javasript"

Posting Komentar