2
I have a Javascript code that was supposed to replace the one marked below:
The platform of this chatbox is FORUMEIROS and the code I’m using is as follows::
$(window).load(function() {
var chatbox_script = function() {
var overrided = Chatbox.prototype.refresh;
Chatbox.prototype.refresh = function(data) {
overrided.call(this, data);
$('.chatbox-username').each(function(){
this.previousSibling&&$.trim(this.previousSibling.nodeValue)=="@"&&$(this.previousSibling).replaceWith('<img src="http://i.imgur.com/zICIAne.png" /> ')
})
};
};
var s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox/index.forum"],iframe[src^="/chatbox/index.forum"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
});
Does the code have some error?
that @ was to be replaced by an image ? give a better indentation in this javascript code please.
– Thiago Friedman
Open the Chrome browser console, in the "console" tab put a 'console.log($. Trim(this.previousSibling.nodeValue))
dentro desse
$('.chatbox-username'). each(Function(){ ... })` and see what it returns. From what I’m seeing this code comes an Minify.– Ivan Ferrer
Did not return anything. Yes, you are supposed to replace @ with the image in the source. > http://i.imgur.com/zICIAne.png
– Fábio Ferreira