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
  OGAds Content Locker Button Script? dictatorce 2 263 2018-04-17, 11:09 PM
Last Post: OPEarner
  looking for script to clean email list Med Fd 3 229 2018-03-08, 07:10 PM
Last Post: Med Fd
  Landing page script help kapdog95 4 272 2018-03-04, 11:48 PM
Last Post: kapdog95
  Put up a link on the button engkusplus 6 304 2018-02-26, 07:49 AM
Last Post: engkusplus
  REQ Movie affiliate CPA Php script mineshparikh 2 239 2018-02-16, 01:11 AM
Last Post: Kjartansson





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

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