zaneliu Posted October 27, 2023 Posted October 27, 2023 (edited) Hi, I'm currently using an Index page to link to a number of projects. I've used custom code injection from this resource (thank you Tuan) to link an image on index and a link in the footer to open an external website in a new tab. This function works as desired with Ajax Loading turned off, but ideally I'd like it to function with Ajax on as well. With Ajax Loading turned on, the original Index page shows a blank screen upon clicking the link (image below). The custom link function also stops working after running through the site a bit. Is there a way to avoid the blank screen or to ensure the link functions even with Ajax on? Thanks for your help! Source: zaneliu.com/work and click on the second image (Wayfinding on Ai Pin) for error Ajax breaking on link click: My Custom Code Injection: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { // open image link new tab $('article.index-item a[href="/wayfinding-humane"]').attr('target','_blank'); // open footer link new tab $('a.index-nav-link[href="/wayfinding-humane"], .page-description a, div#collection-footer-6518953523d07e0831e2e9bd a').attr('target','_blank'); // Humane image $('article.index-item a[href="/wayfinding-humane"]').attr('href','https://michaelandzanes.website'); // Bottom link for Humane $('a.index-nav-link[href="/wayfinding-humane"]').attr('href','https://michaelandzanes.website'); }); </script> Edited October 27, 2023 by zaneliu
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment