Java Snippet Not Functional

User 477833 Photo


Registered User
7 posts

Hello,

I am having an issue including the following java snippet on a webpage and making it work.
<script type="text/javascript" id="90418698" src="//collective2.com/js/c2monthly.js">

The source code from the provider can be found here: http://www.collective2.com/snippets.

I created an HTML box in VSD and I copy-pasted the above code in it. I tried both in the BODY and the HEADER. Nothing works. There is simply nothing showing up. I noticed that including the code in BODY though blocked all text from the page to appear. Only pictures do.

I am stuck. Can anyone let me know what I am missing please and make it work?

Thanks in advance!
User 38401 Photo


Senior Advisor
10,951 posts

FX Physics wrote:
Hello,

I am having an issue including the following java snippet on a webpage and making it work.
<script type="text/javascript" id="90418698" src="//collective2.com/js/c2monthly.js">

The source code from the provider can be found here: http://www.collective2.com/snippets.


Not sure if this is the issue. but the src= setting does not have a complete URL so it's either missing the

http:

in the front of the //, or it needs to just have 1 forward slash in the front like so:

src="/collective2.com/js/c2monthly.js"

also the link you provided for the code does not work.

Hope that helps :)
User 477833 Photo


Registered User
7 posts

Thanks Jo Ann. I figured it out. The right syntax is:

<script type="text/javascript" id="90418698" src="//collective2.com/js/c2monthly.js"></script>

VERSUS
<script type="text/javascript" id="90418698" src="//collective2.com/js/c2monthly.js">

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.