Hi, I for some reason can't get the link to pop-up on a new window. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi, I for some reason can't get the link to pop-up on a new window.

Here's the code I wrote to make this happen. Can you please tell me what's wrong with it? <p align=center><a href="https://www.facebook.com/petros.moulatsiotis.9" target="_blank"><img src=https://f4.bcbits.com/img/a2750339549_10.jpg height=50% width=20%border=2px alt="" /></a><br /><strong>Chill Coding Practice</strong></p>

9th Nov 2019, 9:14 PM
Petros Moulatsiotis
10 Answers
+ 3
Pop-up on a new window will not work here in Sololearn because your target is not related to Sololearn links and also because it not a browser so it will always open in other application like a browser. But if you will try it on Sololearn Website then it will open in a new window.
9th Nov 2019, 9:19 PM
A͢J
A͢J - avatar
+ 3
Open in browser and click on link it will work fine as I am seeing there is no problem.
9th Nov 2019, 9:27 PM
A͢J
A͢J - avatar
+ 3
If you are talking about new window not a tab then there is a solution:- "You can open a new window (HTML4) or a new browsing context (HTML5). Browsing context in modern browsers is mostly "new tab" instead of "new window". You have no influence on that, and you can't "force" modern browsers to open a new window." But if you want to open it on new window then you can simply do with onclick event like this:- <a href="#" onclick="window.open('https://www.facebook.com/petros.moulatsiotis.9', 'newwindow', 'width=300,height=250'); return false;">Chill Coding Practice</a>
9th Nov 2019, 10:08 PM
A͢J
A͢J - avatar
+ 2
It's working fine. Please clear your browser history first
9th Nov 2019, 9:32 PM
A͢J
A͢J - avatar
+ 2
Are you able to open it in new browser tab?
9th Nov 2019, 10:00 PM
A͢J
A͢J - avatar
+ 1
Run it on PC. Your code is fine
10th Nov 2019, 10:19 AM
keivan Ipchi
keivan Ipchi - avatar
0
I was trying this from notepad and opening it as a .html file
9th Nov 2019, 9:23 PM
Petros Moulatsiotis
0
Yeah it still opens on the same window for some reason :/
9th Nov 2019, 9:29 PM
Petros Moulatsiotis
0
I tried clearing everything still doesn't work
9th Nov 2019, 9:42 PM
Petros Moulatsiotis
0
I'll try that as soon as i get home but anything is better than it replacing the original tab and opening the new link in its place. Tab/window
10th Nov 2019, 1:00 AM
Petros Moulatsiotis