JavaScript File
JavaScript File เคो Multiple HTML File เคฎें Add เคिเคฏा เคा เคธเคเคคा เคนैं|
Syntax for External JavaScript
<script type="text/javascript" src="external_js.js"></script>
External Javascript
External Javascript เคฎें script tag เคी เคोเค เคเคฐुเคฐเคค เคจเคนीं เคนोเคคी เคนै| เคฏเคฆि script tag เคฒเคाเคฏा เคाเคฏे เคคो,เคญी เคोเค เคฆिเค्เคเคค เคจเคนीं เคนोเคคी เคนै| external_js.js เคเคฐ Hello.html เคฏे เคฆोเคจों files เคเค เคนी path เคฏा location เคชเคฐ เคนोเคจा เคाเคนिเค , เคคเคญी เคนเคฎเคฐा File Run เคนोเคा|
External Javascript เคฎें 'src' เคชเคฐ 'js' file เคा เคชूเคฐा path เคญी เคฆिเคฏा เคाเคคा เคนै |
external_js.js
Q :- Write a External JavaScript program to print 'Hello World'.
HTML File
Source Code :
<!DOCTYPE html> <html> <head> <title>External JS</title> <script type="text/javascript" src="external_js.is"> </script> </head> </html>
External JavaScript File.
Source Code :
document.write("Hello World");
Output :-
Hello World
Post a Comment
If you have any doubts,Please let me know