Jump to content

How to open code injection in a new tab

Recommended Posts

Hi there,

My client has a badge injected in the footer of her website and, when selected, brings the visitor off her website. I'd like it to open in a new tab. I've searched online and the solutions are not working for me. Can someone help with this?

Thank you!

I am a blogger who launched www.bikekitz.com in October 2018.

Link to comment
  • Replies 5
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Oh sorry, when I posted the question it asked for a web address, so I assumed you had it.

This is the website: https://www.progressioncounselling.com/

There's a badge in the footer that links to a page off the website when selected. I'd like this page to open in a new tab.

This is the code injection:

<!-- Professional verification provided by Psychology Today --> 
<a href="https://www.psychologytoday.com/profile/312544" class="sx-verified-seal"></a> 
<script type="text/javascript" src="https://member.psychologytoday.com/verified-seal.js" data-badge="13" data-id="312544" data-code="aHR0cHM6Ly93d3cucHN5Y2hvbG9neXRvZGF5LmNvbS9hcGkvdmVyaWZpZWQtc2VhbC9zZWFscy9bQkFER0VdL3Byb2ZpbGUvW1BST0ZJTEVfSURdP2NhbGxiYWNrPXN4Y2FsbGJhY2s="></script> 
<!-- End Verification -->

Thank you so much!

 

I am a blogger who launched www.bikekitz.com in October 2018.

Link to comment
On 1/8/2024 at 9:50 PM, Jen-X said:

Oh sorry, when I posted the question it asked for a web address, so I assumed you had it.

This is the website: https://www.progressioncounselling.com/

There's a badge in the footer that links to a page off the website when selected. I'd like this page to open in a new tab.

This is the code injection:

<!-- Professional verification provided by Psychology Today --> 
<a href="https://www.psychologytoday.com/profile/312544" class="sx-verified-seal"></a> 
<script type="text/javascript" src="https://member.psychologytoday.com/verified-seal.js" data-badge="13" data-id="312544" data-code="aHR0cHM6Ly93d3cucHN5Y2hvbG9neXRvZGF5LmNvbS9hcGkvdmVyaWZpZWQtc2VhbC9zZWFscy9bQkFER0VdL3Byb2ZpbGUvW1BST0ZJTEVfSURdP2NhbGxiYWNrPXN4Y2FsbGJhY2s="></script> 
<!-- End Verification -->

Thank you so much!

 

Use this new code

<!-- Professional verification provided by Psychology Today --> 
<a href="https://www.psychologytoday.com/profile/312544" class="sx-verified-seal" target="_blank"></a> 
<script type="text/javascript" src="https://member.psychologytoday.com/verified-seal.js" data-badge="13" data-id="312544" data-code="aHR0cHM6Ly93d3cucHN5Y2hvbG9neXRvZGF5LmNvbS9hcGkvdmVyaWZpZWQtc2VhbC9zZWFscy9bQkFER0VdL3Byb2ZpbGUvW1BST0ZJTEVfSURdP2NhbGxiYWNrPXN4Y2FsbGJhY2s="></script> 
<!-- End Verification -->

(I added target="_blank")

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
  • 2 weeks later...

Add this code under your code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
   setTimeout(function(){
	$('a.sx-verified-seal').attr('target','_blank');
     }, 2000);
});
</script>

 

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

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.