-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11-JavaScript-in-browser.html
30 lines (25 loc) · 1.07 KB
/
11-JavaScript-in-browser.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>javaScript in browser</title>
</head>
<body>
<!-- // two ways to run your javaScript
1: using script tag in under body tag. which you can see we are also doing.
example:
<script>
javaScript code
</script>
2: using extrenal final with src link
example:
<script src="#your file location"></script>
note: we suggest to use the 2nd method the extrenal file with src link.
because it will seprate your concerns and provide browser caching which browser will save your file in his temporary memory which it will not reload your file again.
now i am making extrenal javaScript file and now we will only use 2nd method.
note: always give your script file link before body closing tag -->
<script src="/javaScript/javaScript-in-browser.js"></script>
</body>
</html>