I want to replace the URLs that are appearing in the Facebook Comment Box on my site, because my Domain Name has changed since those comments with URLs were posted.
For example, Change all:
Site1.com => site2.com
Site1.com => Site2.com
I made a code that works in general on my site, to replace text stings:
$("div").each(function (i) {
$(this).html($(this).html().replace('site1.com','site2.com'));
});
The problem is that the Facebook Comments box is inside an iFrame.
So can someone help me edit this code to target the text inside the iFrame?
I guess it should not be too hard, but I'm a noob at JavaScript/jQuery. Sorry.
Also, I wonder if because of the way the Comment box is loading (not instantly, looks like Ajax), it is affecting the timing at which my script can modify the text in the Facebook Comment boxes.
Please let me know if you understand what I mean.
Maybe I need to do something to activate the JS at the right moment?
I try to load it after the <body>
at the moment.