I'm working with a VisualForce page (SalesForce related) and I need to write a piece of JavaScript that will replace some text on the page after everything is loaded.
I've tried the following (I'm using jQuery on other parts of the page so I've used jQuery for this also):
var j$ = jQuery.noConflict(); j$(document).ready(function() { var replaced = $find("body").html().replace('Test','1234'); $("body").html(replaced); });
Unfortunately it doesn't seem to do anything. It's like I can't get the page HTML code. I'm assuming it's because this is a VisualForce page running on the Force platform, so if anyone can offer any help with this that would be much appreciated.
Thanks.
P.S. In case anyone is wondering why I'm doing this is because I can't do this through VisualForce or Apex since I'm trying to unescape some HTML characters provided by a variable and being used in a dataTable header. Unfortunately everything in a dataTable header is automatically escaped.