Localmotionuk Posted June 16, 2022 Share Posted June 16, 2022 Site URL: https://cornet-asparagus-m6a4.squarespace.com/new-page Hi all, I have added a code block into my website which I would like to allow the user to click on a title (Job Description) and the link take the user to a new tab. This is the code I have, hoping someone can help me alter to allow new tab to be opened when clicked. <script src='https://www.workable.com/assets/embed.js' type='text/javascript'></script> <script type='text/javascript' charset='utf-8'> whr(document).ready(function(){ whr_embed(562726, {detail: 'titles', base: 'jobs', zoom: 'country', grouping: 'none'}); }); </script> <div id="whr_embed_hook"></div> Thanks for your help. Link to comment
tuanphan Posted June 16, 2022 Share Posted June 16, 2022 Add this to Last Line in Code Injection > Footer <script> $(document).ready(function() { $('h3.whr-title a').attr('target','_blank'); }); </script> Localmotionuk 1 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
Localmotionuk Posted June 16, 2022 Author Share Posted June 16, 2022 Thanks for this, unfortunately it still opens in the same tab? Link to comment
tuanphan Posted June 17, 2022 Share Posted June 17, 2022 1 hour ago, Localmotionuk said: Thanks for this, unfortunately it still opens in the same tab? Try this new code <script> $(document).ready(function() { setTimeout( function() { $('h3.whr-title a').attr('target','_blank'); }, 3000); }); </script> Localmotionuk 1 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
Localmotionuk Posted June 17, 2022 Author Share Posted June 17, 2022 Thanks, still doesn't work I'm afraid. I was given this by Workable but i cant seem to make it work either: whr(document).on('click', 'li.whr-item a', function(e) { e.preventDefault(); window.open(this.href, '_blank'); }); Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment