27
dayo
9y

I just found this bit of code in our product :P

setInterval(function () {
$("body").find("div, td").replaceText("oldProductName", "newProductName" );
}, 50);

Comments
  • 0
    Don't really see the problem here besides client performance.
  • 0
    @olback why replacing it every 50ms when you can do it once at pageload?
  • 0
    @apisarenco then make it a function and implement it in the ajax. Success/done :)
  • 0
    @apisarenco you win haha
  • 0
    @resdac Live update without reload? I don't know.
  • 5
    They can't just change the product name once in the DB? 🤔😀
  • 1
    There is only one occurrence of the produce name in our software and that is loaded on page load 😓
  • 0
    but what if the product name is in a h1 or p? Or what if a third party site refers to the old name?

    Better just infect your clients with malware so you can install a network traffic sniffer which replaces all occurrences directly in the packets.
Add Comment