Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:26:24+00:00 2026-06-17T10:26:24+00:00

There are some services (like FB like or AddThis) that provide a snippet of

  • 0

There are some services (like FB like or AddThis) that provide a snippet of code.
It looks like

<div class="service-name" data-something="x"></div>
<script type="text/javascript" src="http://example.com/service-name.js"></script>

OK, cool, so normally you paste it to your HTML and it works. Not with Meteor.

Here’s what I see:

  • <script> inside of template / body is not loading — I don’t see it in Resources, something in Meteor is actually preventing browser from recognizing it as a JS file
  • it works from <head>

Now here are the problems and questions:

  1. I don’t want loading it from <head> — because of the speed
  2. Even if I load it from there — we have QA and PROD environments. They must load this script from different domains (like service-domain-qa.example vs. example.com)

And surprisingly you cannot use template helpers / variables in the <head>.

With traditional frameworks it’s not a question at all – you can include scripts anywhere and they just load; you can use logic / variables in any part of you server templates.

So, how should I do this in Meteor?
Let me repeat:

  • I need some external scripts (hosted on 3rd party domain) to be loaded into my app page
  • Saving this script into my project’s folder is not an option
  • Script path depends on the environment (we already have the settings system), so the place of the template that renders it should be passed some data from the code

I know the way to achieve this with dynamic script loading from my code (with LAB.js or whatever) on Template.created, but this is so much an overkill…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:26:25+00:00Added an answer on June 17, 2026 at 10:26 am

    <script> tags in body or templates aren’t executed by Meteor, they are parsed and then handled by Meteor’s templating system. You can’t expect a script tag in either of those to just work as it would with a normal HTML page.

    The solution is to use Template events (where you could manually append the script tag to the body or something) or load it dynamically like you said. It’s not overkill, it’s how Meteor works – remember, there is no traditional HTML page or body, there’s just the Meteor API, and the Meteor API specifies that in order to load and execute external scripts, you must use the appropriate API methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a few web methods that I use to call some external services like
There are some windows services hosted whose display name starts with a common name
We have some services utilizing SunRPC on Linux (RHEL 4/5) that we'd like to
Let's say I have a service interface that looks like this: public interface IFooService
I have some web methods in an asmx web service that currently look like
There are some web-based services such as converting .flv files into .mp3 files, .doc
I am writing WCF service hosted in WinForms application. Is there some way to
I have a basic windows service which does some conversions of data. There's decoupled
Hi I'm bringing back some items from a web service that contains three strings.
Is there some kind of software that I can feed uploaded images to and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.