I am making a website and using java script extensively. I need to find the script tag in file every time I need editing in script tag. Can i use script tag outside the head. Also tell me if I can use script tag anywhere does it makes any change in processing. Please help. Thanks in advance.
tag in html issue
If you are a beginner in JavaScript, you can use the HTML files you saved from other websites as your reference. It should help you learn how the JavaScript is used in the page like the way it was inserted in the page or how a JavaScript was called. This is the easiest way you can learn how JavaScript is applied in a webpage and its function.
You can use JavaScript inside and outside the head tag of the HTML document. When a JavaScript is added inside the head tag, it should be inside the “<script type="text/javascript"> … </script>” tags. For example:
<script type="text/javascript">
var adfly_id = 5760832;
var adfly_advert = 'int';
var frequency_cap = 5;
var frequency_delay = 5;
var init_delay = 3;
</script>
<script language="JavaScript" type="text/javascript">var VerifyCode = "0286f20950765b2";</script>
There is also another way of using JavaScript without inserting all the codes in the HTML document. You can create a JS file and then put all your JavaScript codes inside. This way, you only need to call for the function names to use your JavaScript instead of putting all the codes on the page. When you create a JS file, it should be placed inside the “</head> … </head>” tags. For example:
-
<script src="http://URL/partnersites.js"></script>
If you want to use JavaScript outside the head tag, it should be inside the body tag.