https://www.icyphoenix.com/viewtopic.php?f=35&t=8802&p=57434#p57434
-----------------------------------
jefazo666
Thu 15 Nov, 2012 13:18

Re: Chat Problem With Internet Explorer
-----------------------------------
I see that you edited your answer. Anyway I will explain this script:

[codeblock]if(typeof String.prototype.trim !== 'function') { // If string prototype does not have trim function
  		String.prototype.trim = function() { // create trim function for String prototype
    		return this.replace(/^\s+|\s+$/g, '');  // implementation with RE for trim function.
  		}
	}[/codeblock]

I think now is more clear. For understand the RE take a look at wikipedia, because is a bit longer to explain, and my english level is not enough. 

I hope again this can help anybody.

I would like to add further information:

If you clear the trim() at the lines with the problems (2 in total), the chat works fine in all browsers without adding anything.
The point is that as I said before, I have no Idea about AJAX and maybe you are doing this trim on every message for security reasons. If this is the case, then the best fix is to add the code I posted. 
If the only reason is visual design, then is better to clear the trim() calling at line 665 from  ./templates/default/ajax_shoutbox_functions_js.tpl and line 36 of ./templates/default/ajax_shoutbox_js.tpl and the chat will work fine in all browsers too.

I don't know how, but the spaces are cleared the same without the trim().


