Multi-site javascript code

Front Page Forums Webmasters Multi-site javascript code

This topic contains 8 replies, has 1 voice, and was last updated by  James 1 year ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #5973 Reply


    I own several hundred domains and also have permission to put JSEcoin code on 300+ other sites. My problem currently is implementing it on several hundred domains (properly) is very time consuming. Why can’t your code automatically detect the domain it is on? If so I can easily include the “single code” to all of our sites. I would attempt to modify your code and do this myself but your terms of service forbid us from modifying the code.

    #5974 Reply


    The way I see it, you are forcing your free users that use your hosting services to install the ad codes, and you would also just put the JS code in that file and it would popup on each website that is hosted there.

    ATTN: New Ad-Codes Need Installed!

    Not a good start. Good luck.

    #5979 Reply


    Those users agree to our ads when they join our services, those ads can and will include mining. If they don;’ like it they can find another “free host” or do the unthinkable and upgrade to paid hosting!

    #5980 Reply


    FYI nothing in this world is “free”, facebook, snapchat, google and all those other “free” services make money off of you because YOU are the product, and they sell your information to other companies. So please don’t tell me “good luck” on how I choose to monetize MY BUSINESS!

    #5981 Reply


    Funny, no one is telling you how to run the business. But that is forcing people to display ads.
    What if some of your users want to display his own JSE code, but your code is already running on their site?

    If you offer them something for free, then it should be FREE. I’m just saying.
    And FYI, I own a business myself and couple of big websites for over 15 years, I know perfectly well that nothing is free.

    #5983 Reply


    Hi Josh,

    There are a few ways to do this.

    If you want to stick to javascript then changing the plugin code from:

    <script type=”text/javascript”> !function(){var e=document,t=e.createElement(“script”),s=e.getElementsByTagName(“script”)[0];t.type=”text/javascript”,t.async=t.defer=!0,t.src=””,s.parentNode.insertBefore(t,s)}(); </script>


    <script type=”text/javascript”> !function(){var e=document,t=e.createElement(“script”),s=e.getElementsByTagName(“script”)[0];t.type=”text/javascript”,t.async=t.defer=!0,t.src=””+window.location.hostname+”/0/0/”,s.parentNode.insertBefore(t,s)}(); </script>

    Make sure you change the publisher ID in the above example and subID if required.

    So here we are basically accessing the domain name using the window.location.hostname variable and then inserting that into the load URL.

    If for any reason that doesn’t work then you could try inserting it server-side. I’m not sure what server side code are you using but using php as an example it would be something like this:

    <?php echo $_SERVER[‘HTTP_HOST’]; ?>

    in place of the domain.

    Hope that helps.

    #5988 Reply


    Sanel, I am NOT forcing anyone to do anything. They AGREE to let us display ads IN EXCHANGE for hosting. It’s in our terms of service. If they want to run ads or JSE code then they need to pay for their own hosting. Do you not understand that “free hosting” isn’t really free? Just like Facebook isn’t free. You are trading your information to them in order to use the platform. If you do not comprehend now then I fear you never will. “Good Luck” with life Sanel, you will need it!

    #5989 Reply


    Thanks James, does each site have to be added to your system (in the dashboard) or will it automatically add new site urls as they are detected?

    #5994 Reply


    It’ll automatically add them when they get their first visit.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Multi-site javascript code
Your information: