Jump to content

MEDEWELL

Member
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MEDEWELL's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. this code was given to us by a third party, the link is as follows: https://techsoup.app.box.com/v/NGOsourceFileBadgeCode And if you download it then it becomes a text file as attached.
  2. So when I use the code the way you have written it, I cannot see anything change on the page, like the icon cannot be seen. See pic below. The full code is as follows <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da"> (function() { function async_load() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; var theUrl = 'http://www.ngosource.org/sites/default/files/ngos_ed_on_file_widget.js'; s.src = theUrl + ( theUrl.indexOf("?") >= 0 ? "&" : "?") + 'ref=' + encodeURIComponent(window.location.href); var embedder = document.getElementById('ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da'); embedder.parentNode.insertBefore(s, embedder); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script>
  3. Oh okay! Sorry... The code for Line 1: <script></script> type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da">
  4. <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da">
  5. I'm not sure about the sending the code, but when I made the changes to the code by correcting the beginning of the code <script to <script></script> the code appeared like that in the footer of the screenshot, immediately when the I changed it. Hope I am making sense. I have added a pic of the code that was pasted in the footer tab, also the </script> is highlighted red.
  6. Site URL: https://rose-bellflower-zcdd.squarespace.com/config/settings/advanced/code-injection Hello there! I am facing a problem with including a file badge code for another website, the code is as follows: <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da"> (function() { function async_load() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; var theUrl = 'http://www.ngosource.org/sites/default/files/ngos_ed_on_file_widget.js'; s.src = theUrl + ( theUrl.indexOf("?") >= 0 ? "&" : "?") + 'ref=' + encodeURIComponent(window.location.href); var embedder = document.getElementById('ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da'); embedder.parentNode.insertBefore(s, embedder); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script> When I uploaded this code on the code-injection tool on my website it showed me a syntax error- so I followed the instructions below: To add JavaScript to a code injection field, surround the code with <script></script> tags. And it kind of worked- as in it appeared on the website but in a text form- see picture for reference. Could you please help as to how to solve this issue? Also, if I'd want this code to appear in like the middle of the page instead of the footer how can I do it? Thanks!
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.