Where should I put <script> tags in HTML?
2017-12-02, 05:00 PM,
#1
So guys im just wondering where is the right place to put the script?
My just site just approved from some popunder network.
Anyone can approve if this is right? 

Example code:

<html>
   <head>
       <title>My Page</title>
       <script type="text/javascript" src="my-script.js"></script>
   </head>
   <body>
       <div id="user-greeting">Welcome back, user</div>
   </body>
</html>
Reply
Share This Thread :
2017-12-02, 06:28 PM,
#2
Yes, you should put the tags in between <head>
Reply
2017-12-03, 12:20 AM,
#3
Yes the code is correct, do it like this.
Reply
2017-12-03, 03:51 AM,
#4
the right place is to put it before the end of the body </body>. This because the website it will loaded before the script and this speed up the process. i also recommend you to put async <script src="x.js" async></script> A script that will be run asynchronously as soon as it is available:

Hostfor.me
https://hostfor.me - Stariting 0.45$/m cpanel ssd 10gb bandwidth ect...
Reply
2017-12-03, 11:34 AM,
#5
Thanks for ur approvement. Really much appreciated.
Reply
2017-12-03, 11:38 AM,
#6
(2017-12-02, 06:28 PM)ashpaulzz Wrote: Yes, you should put the tags in between <head>

(2017-12-03, 12:20 AM)sudipda Wrote: Yes the code is correct, do it like this.

Thanks for ur approvement. Really much appreciated.

(2017-12-03, 03:51 AM)HostForMe Wrote: the right place is to put it before the end of the body </body>. This because the website it will loaded before the script and this speed up the process. i also recommend you to put async <script src="x.js" async></script> A script that will be run asynchronously as soon as it is available:

thanks man, im gonna try this and pm u if i encounter a problem.
Reply


Related Threads
Thread Author Replies Views Last Post
  REQ Movie affiliate CPA Php script mineshparikh 2 103 2018-02-16, 01:11 AM
Last Post: Kjartansson
  [ASK] Movie Streaming Website Script sonpink 19 4,356 2018-02-15, 05:21 PM
Last Post: mineshparikh
  Script Facebook daavin 4 220 2018-02-08, 11:29 PM
Last Post: faithalo
  How to put HTML landing page script in blogger walterzingo 4 206 2018-02-03, 06:55 PM
Last Post: umberblue
  Why people don't put website url in youtube description (BH Niches) akimo10 8 478 2018-01-26, 08:56 PM
Last Post: tamnga





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2018 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top