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

202
Views
enlace href a js y valide el perfil del usuario para visitar la url

Tengo html href y estoy vinculado a una función en el archivo js. Desde el html cuando el usuario hizo clic, validará el perfil del usuario por país. Si el perfil del usuario = TH y SG, abrirá una url, de lo contrario, abrirá b url. Por favor, ayúdame. no se que le pasa a mi codigo

 /* API Completion */ api.done(function (a, c, d) { console.log(ad); var countryCode = ""; function checkCountry(upp) { return upp.Key === "CountryCode"; } var arrUPP = adUserProfileProperties.results.filter(checkCountry); //btn.addEventListener("click", travel); $(document).ready(function() { //$('ul.nav li').click(function() if (arrUPP.length > 0 && arrUPP[0].Value) { countryCode = arrUPP[0].Value; } else if (countryCode == "TH" && countryCode == "SG") { window.location.href = 'https://....a url'; } else { window.location.href = 'https://....b url'; return; } }); //} }); api.fail(function (a, b, c) { var errorMessage = []; errorMessage.push(errorMessage); errorMessage.push("Error: " + a.responseJSON.error.message.value); alert(errorMessage.join("\n")); });
 <li class="main"> <a class="travel" href="javascript:travel();" target="blank"> <i class="icon-travel"></i> <span>Country</span> </a> </li>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto nunca será cierto countryCode == "TH" && countryCode == "SG" . Espera que un valor sea tanto "TH" como "SG". Probablemente quisiste usar || .

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!