- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello,
I am learning HTML and using codepen.io and I would like to make a link pop in a new window instead of a new tab. I have tried everything but it doesn’t work. Check out what I have here: http://codepen.io/anon/pen/CviGa
Any help would be really amazing.
Thanks!
Jacob
I would like to make a link pop in a new window instead of a new tab
A new window…you mean have two browsers open at the same time?
I suppose it might be possible but it’s generally considered a poor idea.
You are imposing your requirements on the user rather than letting the user make their own decisions.
A search on google took me to a nice stack overflow link.
Short Answer: you need js or you can leave the target as blank and hope that the user has their settings to open another window.
http://stackoverflow.com/questions/12939928/make-a-link-open-a-new-window-not-tab
Hi theacefes,
it works! :D check it out here: http://codepen.io/anon/pen/KBdFa
Do I need to have both page links in there for it to always work?
Nope, you can remove the link in the href .
Now, as Paulie_D pointed out, forcing a new window to open is actually not that great of a user experience so you may want to think of a different way to handle that action if you care about your UX. Additionally, you may want to externalize that js from an inline “onclick” to reference an external js file with the associated code.