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
  GEO Redirection Script immart247 7 242 2018-10-31, 12:40 PM
Last Post: JenniN
  I want to put CPAGrip code on my domain walid2435 4 219 2018-09-23, 01:24 PM
Last Post: neverstop
  Youtube Tags martek 2 270 2018-09-06, 11:39 AM
Last Post: martek
  movie search engine script ENCRYPT 7 383 2018-06-05, 12:49 AM
Last Post: CharlieHarper
  OGAds Content Locker Button Script? dictatorce 2 686 2018-04-17, 11:09 PM
Last Post: OPEarner





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

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