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

318
Views
Cómo ir a un HTML específico cuando se detecta una palabra (Java)

Java Hice un HTML llamado hello.html y ahora quiero usar la función replace() en Java para ir a la página HTML cuando se detecta la palabra "Covid" en Google, lo intenté pero no funciona por alguna razón , ¿puedes ver dónde me estoy equivocando o tengo que cambiar todo mi código?

 function redirectURL() { var specWord = getSpecificWord(); switch(specWord) { case 'corona': window.location.replace('hello.html'); break; case 'covid': window.location.replace('hello.html'); break; case 'covid-19': window.location.replace('hello.html'); break; default: return true; break; } return false; // don't let the form submit } function getSpecificWord(Element) { var specificWord = "corona"; return specificWord; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El código no funciona porque no está llamando a la función redirectURL .

Agregue redirectURL() a su código o use esto en su lugar:

 (function redirectURL() { var specWord = getSpecificWord(); switch (specWord) { case 'corona': window.location.replace('hello.html'); break; case 'covid': window.location.replace('hello.html'); break; case 'covid-19': window.location.replace('hello.html'); break; default: return true; break; } return false; //don't let the form submit })(); function getSpecificWord(Element) { var specificWord = 'corona'; return specificWord; }
about 4 years ago · Juan Pablo Isaza 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!