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
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, 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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

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