At this point, I’m learning how to launch a pop-up

At this point, I’m learning how to launch a pop-up

March 3, 2006 · 1 min read
post

What’s more: I’m not ashamed to admit it. :P
The webmaster world is a never-ending cycle of learning and relearning things… maybe that’s why I like it so much. Some even take pride in teaching me something I didn’t know (hey Rodrigo?), while others ask me to keep writing more and listening to less music (hey Tito Tommy?).

Anyway, back to the point: launching pop-up windows with JavaScript. It turns out that, regardless of the debate about whether pop-ups should be used at all, there’s a problem that systematically corrupts them, makes them harmful, attacks both advanced and novice users during navigation, confuses search engines, and generates noise in the code. The issue is that, although there are several ways to launch a pop-up using JavaScript, the most commonly used ones are the wrong ones.

The correct way to launch a pop-up window with JavaScript

The following is the code you should use to launch a pop-up:
<a href="https://albertlg.com/index.htm" target="_blank" onClick="window.open(this.href, this.target, 'width=300,height=400'); return false;">Launch correctly</a>
Launch correctly


Simply change href="https://albertlg.com/index.htm" to the name of the .htm file you want to open in the new window, and adjust the width and height values according to the desired dimensions (in pixels).

For more information: NSU.

Albert López
Author
SEO, Content Marketing & LLMs (AI) Advisor
Since 1998 I’ve lived at the intersection of technology, content and search. I’ve worked as a designer, developer, SEO and entrepreneur in projects like Solostocks, Softonic, Uvinum and Drinks&Co. Today I’m partner and SEO Manager at Mindset Digital, driving SEO for LLMs and exploring new projects. Always learning, always optimising.