Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Javascript

Cuando alguien vaya a abandonar mi web, que salga un msgbox preguntando si de verdad quiere salir de ella o no, y en caso contrario le redirige a otra web.
Lo tengo casi conseguido pero me falla y se queda en bucle.
El codigo que tengo es el siguiente:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

<script type="text/javascript">
var nosalir=false;
var mensajealerta = ' no te vayas!!! ';
var mensaje = 'Si te quedas te regalo un cromo';
function DisplayExitSplash() {
    if (nosalir == false) {
        window.scrollTo(0, 0);
        window.alert(mensajealerta);
	   if(confirm(mensajealerta))
		{
       location.href="http://www.ya.com";
	   die();
		}
 
        return mensaje;
    }
}
window.onbeforeunload=DisplayExitSplash;
</script>
over 4 years ago · Wilmer jose Gutierrez guerra
1 answers
Answer question

0

s

over 4 years ago · Manuel felipe Rivera ossa Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!