Abrir 2 URLs en una Landing Page con un sólo click
Iniciado por Sauron · 6 feb 2019 · 0 respuestas · 7245 visitas
Sauron Con este código cuando un usuario pinche en un link de tu LP que lo lleve a la oferta, se la abrirá en una nueva ventana y en la otra ventana le saldrá una página por ejemplo de testimonios que he puesto de ejemplo: http://dominio.com/testimonios.html
Así que en caso de cerrar la pestaña donde está viendo la oferta le saldrá la pestaña donde hemos cargado los testimonios y aún tenemos una segunda oportunidad de convencer.
<!-- Blank Reload --> <script type="text/javascript"> function blank() { window.addEventListener('load', function() { var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { var l = links[i]; if (l.href) { if (l.href.substring(0, 4) == 'http' && l.href.indexOf('#') == -1) { l.setAttribute('target', '_blank'); } } } }); } blank(); function reload() { window.addEventListener('load', function() { var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { var l = links[i]; if (l.href) { if (l.href.substring(0, 4) == 'http' && l.href.indexOf('#') == -1) { l.onclick = function() { var links = 'http://dominio.com/testimonios.html'; var index = Math.floor(Math.random() * links.length); location.href = links[index]; } } } } }); } reload(); </script> <!-- Blank Reload END-->
Este hilo pertenece al archivo del foro y ya no admite respuestas.
Otros hilos de esta sección
- Social Locker simple en HTML y JavaScriptSauron · 16 jun 201420 respuestas · 47.307 visitasÚltimo mensaje: 7 dic 2018
- Script para postear en diferentes grupos de Facebookrodrigol · 6 jun 201418 respuestas · 43.485 visitasÚltimo mensaje: 7 may 2018
- Scrapear con phytoncarlosse · 3 may 201411 respuestas · 24.557 visitasÚltimo mensaje: 19 mar 2017
- Desofuscar código JavaScriptSauron · 7 ago 20147 respuestas · 18.061 visitasÚltimo mensaje: 12 oct 2016
- Redirección .htaccess de un dominiowrongchris · 15 mar 20174 respuestas · 15.565 visitasÚltimo mensaje: 29 nov 2017
- Scrapear utilizando PHP nativo y la librería CurlSauron · 19 mar 20147 respuestas · 15.162 visitasÚltimo mensaje: 9 jul 2015
- Ayuda script para forzar a ver anuncio a los usuariosdobrick · 26 feb 20185 respuestas · 15.034 visitasÚltimo mensaje: 12 may 2019
- Duda para desarrolladores webharmonica · 8 may 20158 respuestas · 14.252 visitasÚltimo mensaje: 20 jul 2015

