{"id":18696194,"date":"2025-10-27T06:45:33","date_gmt":"2025-10-27T06:45:33","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=18696194"},"modified":"2025-10-27T07:52:57","modified_gmt":"2025-10-27T07:52:57","slug":"problem-with-onclickjavascriptwindow-open","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/problem-with-onclickjavascriptwindow-open\/","title":{"rendered":"Problem with: onclick=&#8221;javascript:window.open"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello guys, how are you? I have a very strange issue on my website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I actually have three identical websites in terms of design and code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, one of them is causing me problems for no reason, and I can\u2019t solve it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I set up an exclusion list for several social media external links:<br \/><a href=\"https:\/\/ibb.co\/0pPj6f0H\">https:\/\/ibb.co\/0pPj6f0H<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is the Facebook icon (link), The Facebook icon is an actual external link to my Facebook page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For some reason, it doesn\u2019t work properly with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>onclick=\"javascript:window.open\"<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I\u2019m not in incognito mode, the page opens in the same tab instead of a new window. when i click F12 and inspect the Facebook icon its not shows me the: <code>onclick=\"javascript:window.open\"<\/code> for facebook. (for all the other social media its shows)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>I set up my other websites the same way, and it works fine, for example:<\/strong><\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/locksmithunit.com\">https:\/\/locksmithunit.com<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/locksmithunit.cat\">https:\/\/locksmithunit.cat<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The problem is specific to this website:<\/strong><\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/locksmithunit.es\">https:\/\/locksmithunit.es<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s important to note that the other social media icons work perfectly fine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All three websites have the same plugin settings and the same code (you can check it using the developer tools, F12).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Any suggestions?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"template":"","class_list":["post-18696194","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18696194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18696194\/revisions"}],"predecessor-version":[{"id":18696308,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18696194\/revisions\/18696308"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18696194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}