Jump to content

JavaScript won't display using code injection

Recommended Posts

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.

Link to comment
  • Replies 3
  • Views 1.1k
  • Created
  • Last Reply
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)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

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

Link to comment

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.