Hi,
I want to add below code with [x_code] shortcode in my post but it displays like on screenshot. Post link is this https://www.soruncozumu.com/target_blank-yerine-relexternal-kullanimi/
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (
anchor.getAttribute("href") && (
anchor.getAttribute("rel") == "external" ||
anchor.getAttribute("rel") == "nofollow" ||
anchor.getAttribute("rel") == "external nofollow" ||
anchor.getAttribute("rel") == "nofollow external" )
)
anchor.target = "_blank";
}
}
window.onload = function() {
externalLinks();
}