Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
Js not loading post link clicks within page

Following is my code to update the price of an item on the page, but the page has some anchor tags that lead to a different url(categories of items to filter) without page refresh and since there is no page refresh, the script isnt loading. I tried turbolinks:load as well with no luck.

    var $ = jQuery.noConflict();
    
$(document).on('ready', function() {
setTimeout(checkPaqe, 3000);
});
        function checkPaqe() {
           var pageType = 'NA';
             pageType = (dataLayer.find(dataLayer => dataLayer.PageType)["PageType"] != null) ? dataLayer.find(dataLayer => dataLayer.PageType)["PageType"]: "NA"
         if (pageType === 'ListingPage' || pageType === 'ProductPage' || pageType === 'HomePage') {
             updatePrice();
         }
     }
     
     
     
     function updatePrice() {
         let pricetags = document.getElementsByClassName("price");
         for (let i = 0; i < pricetags.length; ++i) {
             var price = pricetags[i].innerHTML;
             price = price.replace('$', '');
             price = parseFloat(price) - 30;
             price = parseFloat(price).toFixed(2);
             pricetags[i].innerHTML = "<s style=\"color:red\">" + pricetags[i].innerHTML + "</s><br><span style=\"font-size: 10px;\">Your price with loyalty voucher <span style=\"font-size: 2.0em;\">$" + price + "</span></span>";
         }
     }
window.onhashchange = function() { 
     console.log('hashchange');  
}

window.onpopstate = function() { 
console.log('popchange');
}   
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda