Jump to content

JavaScript won't display using code injection

Recommended Posts

Posted

I work for a church and am not super technical. I need to show a directory of churches in our area. I was told to put this into the code injection footer of my site:

<script type="text/javascript">
(function($){ jQuery(document).ready(function () {
$('#kcDiv').load("https://uccwebservices.ucc.org/uccko/churchcontent.aspx?st=ks");
}); })(jQuery);
</script>

And then on the page where I want the directory to be, in HTML, put this:

<div id="kcDiv"></div>

So that it will display the churches. However, nothing happens. When I go into incognito mode to test this, it's just blank. I'm not sure what to do next. Thank you for your help.

  • Replies 3
  • Views 1.3k
  • Created
  • Last Reply
Posted
10 hours ago, koconference said:

I work for a church and am not super technical. I need to show a directory of churches in our area. I was told to put this into the code injection footer of my site:

<script type="text/javascript">
(function($){ jQuery(document).ready(function () {
$('#kcDiv').load("https://uccwebservices.ucc.org/uccko/churchcontent.aspx?st=ks");
}); })(jQuery);
</script>

And then on the page where I want the directory to be, in HTML, put this:

<div id="kcDiv"></div>

So that it will display the churches. However, nothing happens. When I go into incognito mode to test this, it's just blank. I'm not sure what to do next. Thank you for your help.

Could you show use the site url with the code on it so we can help

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Posted

Remove above code

Edit page where you want to show directory

Add a Code Block > Paste this code

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script type="text/javascript">
(function($){ jQuery(document).ready(function () {
$('#kcDiv').load('https://uccwebservices.ucc.org/uccko/churchcontent.aspx?st=ks');
}); })(jQuery);
</script>
<div id="kcDiv"></div>

cript.thumb.png.9fc0871844f06bdb87230ee7d680d1d6.png

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!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.