Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Code not working with Ajax loading


Alice31302

Question

Site URL: https://mommytomom.com/

Hi everyone. I would like to enable Ajax loading on my site but it doesn't work with my social sharing buttons and code I use on a few pages. I am not very knowledgeable with coding so I wanted to ask here if there is anything I can do. Is there a code you can add that makes the page refresh each time? I disabled Ajax for now but can turn it back on to troubleshoot if needed. The social buttons I'm referring to are through Shareaholic, they only show up if you refresh the page.  Thanks in advance for any help :)

Code injection

<!-- BEGIN SHAREAHOLIC CODE -->
<link rel="preload" href="https://cdn.shareaholic.net/assets/pub/shareaholic.js" as="script" />
<meta name="shareaholic:site_id" content="73ca7139ab230a40546bce24cbe1c713" />
<script data-cfasync="false" async src="https://cdn.shareaholic.net/assets/pub/shareaholic.js"></script>
<!-- END SHAREAHOLIC CODE -->

The other code I'm referring to I only have on my secondary navigation pages that I want to look like landing pages. It removes the header and footer. https://mommytomom.com/want-to-work-from-home

Pages settings, advanced 

<style>
     .Header, .Footer, .Mobile-bar, .Mobile-bar--top, .sqs-announcement-bar-custom-location{
     display:none !important;
     }
 </style>

Link to post
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Hey @Alice31302,

I have the same problem on a brine template.
What I am doing now, as I want to keep the Ajax loading on is instead of putting the css on in page header code injection, I target the page collection ID and add my code to custom css.

So something like that:

#collection-5ee62abcf25ac108a926be69{  
.Header, .Footer, .Mobile-bar, .Mobile-bar--top, .sqs-announcement-bar-custom-location{
     display:none !important;
     }
}

Works for me as I'm Inverting the logo color on different pages, or customising the index navigation to show specific items.

hope it helps, It's not a solution to code injection thingy with ajax but a good workaround.

Best,
Fabien

Link to post
  • 0

You can use @MidnightClub solution + Follow this guide to find Page collection ID.

You can send your question to my email to get faster answer. / How to Setup Password & Share URL 

-- I'm Tuan, work for a non-profit project (build free libraries). I check the forum once or twice a day to help out the community. If you don't see me answering your question, you can send it to the email above. 

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...