MEDEWELL Posted June 28, 2022 Share Posted June 28, 2022 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! Link to comment
tuanphan Posted June 29, 2022 Share Posted June 29, 2022 Hi, I see in screenshot, your code has some invalid code. Can you send code when you paste to Code Injection > Footer? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 1, 2022 Author Share Posted July 1, 2022 (edited) 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. Edited July 1, 2022 by MEDEWELL More pics Link to comment
tuanphan Posted July 1, 2022 Share Posted July 1, 2022 Line 1 is incorrect. Can you send Line 1 code? I can give new code easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 1, 2022 Author Share Posted July 1, 2022 <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da"> Link to comment
tuanphan Posted July 2, 2022 Share Posted July 2, 2022 13 hours ago, MEDEWELL said: <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da"> I meant this line Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 6, 2022 Author Share Posted July 6, 2022 (edited) 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"> Edited July 6, 2022 by MEDEWELL Link to comment
tuanphan Posted July 7, 2022 Share Posted July 7, 2022 20 hours ago, MEDEWELL said: 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"> It should be <script type="text/javascript" id="ngos-ed-on-file-widget-script-17336c1f-917d-492b-bc53-225c95e103da"> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 11, 2022 Author Share Posted July 11, 2022 (edited) 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> Edited July 11, 2022 by MEDEWELL Link to comment
tuanphan Posted July 11, 2022 Share Posted July 11, 2022 https://rose-bellflower-zcdd.squarespace.com/?noredirect Your site is private. Can you setup password & share url again? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 12, 2022 Author Share Posted July 12, 2022 https://rose-bellflower-zcdd.squarespace.com/config/ Link to comment
tuanphan Posted July 12, 2022 Share Posted July 12, 2022 2 hours ago, MEDEWELL said: https://rose-bellflower-zcdd.squarespace.com/config/ Still private. See this Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 18, 2022 Author Share Posted July 18, 2022 Hello tuanphan, Any luck on resolving the above problem. Link to comment
tuanphan Posted July 18, 2022 Share Posted July 18, 2022 On 6/28/2022 at 5:28 PM, MEDEWELL said: 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! Where did you get this code? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted July 26, 2022 Author Share Posted July 26, 2022 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. Link to comment
MEDEWELL Posted August 10, 2022 Author Share Posted August 10, 2022 Hello there! Any hope in fixing the issue. Link to comment
tuanphan Posted August 11, 2022 Share Posted August 11, 2022 18 hours ago, MEDEWELL said: Hello there! Any hope in fixing the issue. They provided an incorrect code. The code missing a character. Use this new code <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 = 'https://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> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
MEDEWELL Posted August 12, 2022 Author Share Posted August 12, 2022 Oh it worked!!!! Thank you! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment