A estas alturas aprendo cómo lanzar una Pop-Up

Y es más: no me da vergüenza reconocerlo. :P
El mundo del webmaster es un no parar de aprender y reaprender cosas... quizá por eso me guste. Incluso los hay que se enorgullecen cuando me enseñan algo que no sabía (eh Rodrigo?), y los que me piden que siga escribiendo más y escuchando menos música (eh Tito Tommy?).

En fín, a lo que íbamos: lanzar ventanas Pop-Up con JavaScript. Pues resulta que, independientemente de las discusiones acerca de usar o no una pop-up, hay un problema que las corrompe sistemáticamente, que las hace perversas, que agrede a usuarios avanzados y principiantes en su navegación, confunde a los buscadores, y genera ruido en el código. Este problema es que, existiendo varias formas de lanzar una Pop-Up con código Javascript, las más usadas son las incorrectas.

La forma correcta de lanzar una ventana Pop-Up con Javascript

El siguiente es el código a utilizar para lanzar una Pop-Up:
<a href="/index.htm" target="_blank" onClick="window.open(this.href, this.target, 'width=300,height=400'); return false;">Lanzar correctamente</a>
Lanzar correctamente


Simplemente cambiar en href="/index.htm" el nombre del archivo .htm que se abrirá en la ventana nueva, y cambiar los valores de width y height según el ancho y alto deseados (en píxeles).

Para más información: NSU.

Albert López
Albert López
SEO, Content Marketing & Web Analytics Advisor

Back in 1998 I came across the Internet while studying computer engineering, and by 2000 its effect had me working on it. I have been a designer, frontend developer, programmer, usability specialist, SEO, entrepreneur, manager, mentor, consultant… In short, I have surely participated in 99% of everything that an internet business encompasses, and always with passion, enthusiasm and TEAM!

Throughout my career I have been lucky enough to be able to surround myself with people better than me and, thanks to an incessant curiosity and eternal thirst for learning, I have always been moved by the new, the unexplored, optimization and measurement, and especially the user experience and the positioning of content to convert.

So far, I have worked at Solostocks (Grupo Intercom), Softonic, Uvinum (a brand I was the proud creator and co-founder of), Drinks&Co Marketplace, and I have collaborated with maaaany startups. Today I am involved in CryptoAdvisor.club and I am diving into the new crypto world (cryptocurrencies, cryptoassets, NFTs, Web3, metaverse, DeFi, etc).

Find me if you are looking for something.

comments powered by Disqus

Related