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

118
Views
Compare la URL con la cadena y la ruta e inserte el texto del enlace

Es una plantilla de publicación que debería funcionar para diferentes publicaciones y en diferentes idiomas. No debe haber diferentes plantillas para diferentes idiomas. Por eso pensé en lo siguiente. Comparo la URL cargada con la cadena y la ruta. Si se cumple la condición, se agregará una URL y un texto al siguiente enlace. Como todavía estoy al principio, me interesan sus comentarios y otros enfoques. Tal vez usted tiene algún comentario. Así que puedo ver lo que puedo hacer mejor. Por favor, ayúdame para que pueda aprender más. Gracias

 var url = window.location.href var path = window.location.pathname var output1 = "http://localhost"; var output2 = output1 + path; $(window).on('load', function () { if (url == output1 + path) { $("a.blog-wort").attr("href", "http://localhost/landing1/"); $('a.blog-wort').text('text 1'); } else if (url == output2) { $("a.blog-wort").attr("href", "http://localhost/en/landing2/"); $('a.blog-wort').text('text 2'); } else if (url == output2) { $("a.blog-wort").attr("href", ""); $('a.blog-wort').text('text 3'); } });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <a class="blog-wort"></a>

about 4 years ago · Juan Pablo Isaza
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!