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
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


Possibly Related Threads...
Thread Author Replies Views Last Post
  Where To Put My CPA Link Into Landing Page? shervin 3 268 2017-10-25, 11:58 PM
Last Post: midastou4
  [JAVA SCRIPT] Need someone to make me an executable!!! CagelessBrain 0 110 2017-10-17, 04:09 AM
Last Post: CagelessBrain
  How To Detect get Script In Landing Page 5light 3 178 2017-10-05, 04:04 AM
Last Post: LB'Decoy
  [HELP] Codes/Script from a BH site to mine cracklings1017 3 187 2017-08-20, 10:58 AM
Last Post: FarrisFahad
  How to put CPAGrip Offer on my domain? xDarkEclipse 4 301 2017-08-05, 07:36 PM
Last Post: Watt





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

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