11th of November 2020 - CPAElites is for sale! As a result of the 4th CEO absence in 2020 (for months): Please click [here] to read more!


Where should I put <script> tags in HTML?
2017-12-02, 01:30 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, 02:58 PM,
#2
Yes, you should put the tags in between <head>
Reply
2017-12-02, 08:50 PM,
#3
Yes the code is correct, do it like this.
Reply
2017-12-03, 12:21 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, 08:04 AM,
#5
Thanks for ur approvement. Really much appreciated.
Reply
2017-12-03, 08:08 AM,
#6
(2017-12-02, 02:58 PM)ashpaulzz Wrote: Yes, you should put the tags in between <head>

(2017-12-02, 08:50 PM)sudipda Wrote: Yes the code is correct, do it like this.

Thanks for ur approvement. Really much appreciated.

(2017-12-03, 12:21 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
  Alternative CPA Network Script reedhawk 5 2,533 2020-01-24, 06:19 PM
Last Post: mic141414
  Looking for a CPA Script Curtis95 5 564 2020-01-23, 11:11 PM
Last Post: cintrondigital
  Which bot should I use for instagram? minatika 2 608 2019-08-30, 12:19 AM
Last Post: Givenchy
  Who is the creator of this script?? rajabadariqbal 1 320 2019-05-10, 02:32 AM
Last Post: CPAElites Moderation Bot
  2 Instagram Methods, Which one should I use? quNax 3 735 2019-04-11, 06:44 AM
Last Post: SynthCat





About Us | Contact Us | CPAElites | Advertise | Stats

Copyright © 2013 - 2020 by (company to be announced later)
Temporarily (!) powered by MyBB, fixed (repaired) and enhanced by Charlie Harper (GitHub) aka Charles Francis Harper (Wikipedia)
Return to top
This forum uses Lukasz Tkacz MyBB addons.