Icy Phoenix
Old Support Topics - Chat Problem With Internet Explorer
jefazo666 [ Tue 13 Nov, 2012 22:35 ]
Post subject: Chat Problem With Internet Explorer
I know that Internet Explorer sucks, and users that insists in using it suck even more, but I'm sure all of we have these users and they want to use it (don't ask me why

).
The problem my users are having, is that the shoutbox of the chat does not show and they can't use it. The same user can use it if he uses FF for example.
here a preview of how they see it:
And the error returned by IExplorer is:
Message: The object does not acept the property or method.
Line: 996
Character: 2
Code: 0
URI:
http://www.club-205.com/forum/ajax_chat.php
If I use IE in my website I get the same error, but I works properly here at
www.icyphoenix.com. The files where uploaded from the original tar an extracted there, so I don't think it's possible to have them wrong.
I think all of you for your help
Limun [ Wed 14 Nov, 2012 05:29 ]
Post subject: Re: Chat Problem With Internet Explorer
chat work perfectly for me in IE9
but i dont have IE below version 9
maybe someone else can test it
username: jefecillo
password: icyphoenix
mort [ Wed 14 Nov, 2012 23:09 ]
Post subject: Re: Chat Problem With Internet Explorer
I know that Internet Explorer sucks, and users that insists in using it suck even more, but I'm sure all of we have these users and they want to use it (don't ask me why

).
Please spare us that type of opinion because half of the twits that use IE don't even know or learn how to set it up, or they are using an old version that is incompatible with what is being used today. And I also believe that people have stopped making things backward-compatible for old versions of anything.
If I use IE in my website I get the same error, but I works properly here at
www.icyphoenix.com.
I think it's trying to tell you something that's it's not an Icy Phoenix problem.
It works for me with Win8 and IE9 - But you fail to say who is using what, which version of IE they are using and very much little else.
And the other problem is, none of us are mind-readers or beta-testers for other websites who go about changing things. So please install a second "Default" version as a test forum and see if your problems still exist with that?
Because you are having more problems than a cat in a dog pound.
jefazo666 [ Thu 15 Nov, 2012 01:02 ]
Post subject: Re: Chat Problem With Internet Explorer
I know that Internet Explorer sucks, and users that insists in using it suck even more, but I'm sure all of we have these users and they want to use it (don't ask me why

).
Please spare us that type of opinion because half of the twits that use IE don't even know or learn how to set it up, or they are using an old version that is incompatible with what is being used today. And I also believe that people have stopped making things backward-compatible for old versions of anything.
If I use IE in my website I get the same error, but I works properly here at
www.icyphoenix.com.
I think it's trying to tell you something that's it's not an Icy Phoenix problem.
It works for me with Win8 and IE9 - But you fail to say who is using what, which version of IE they are using and very much little else.
And the other problem is, none of us are mind-readers or beta-testers for other websites who go about changing things. So please install a second "Default" version as a test forum and see if your problems still exist with that?
Because you are having more problems than a cat in a dog pound.
I'm sorry mort if anything of I said made any kind of injury in you. I was joking about IE and I don't really think that people who use is it Stupid or something like that. I am not coming here to make enemies or disturb people, my intentions are learn and cooperate.
For further information, Windows XP allows you to install until internet explorer 8 versions. I would like my website available too for people without money enough to renew their computers, and people without so much knowledge about computers. As a developer, my opinions is that services should be adapted to users, not users adapt to services.
I don't know why do you think my website has any kind of fix by me. All I did was following the instructions here founded. There are some modifications at styles, but there is a difference too high between the view and the controller.
Finally, I am sorry for make all this questions, I thought support means support, not support with quota.
Adding info to the main topic:
Users with this problems use Internet Explorer 8 or older. Sorry for don't mentioned it before.
the problem is right here:
./templates/default/ajax_shoutbox_js.tpl
function checkStatus(focusState)
{
var text = $("#chatbarText");
var submit = $("#submit");
submit.attr("disabled", ((text.val().trim() != "") || (focusState == "active")) ? false : true);
}
it seems that internet explorer 8 and olders versions don't acept the submit button to have the disabled attribute. I have been browsing about this in the web, but I don't have any Idea about AJAX, so I can't move fast solving this. Any help will be welcome.
mort [ Thu 15 Nov, 2012 03:36 ]
Post subject: Re: Chat Problem With Internet Explorer
I would like my website available too for people without money enough to renew their computers, and people without so much knowledge about computers. As a developer, my opinions is that services should be adapted to users, not users adapt to services.
TAke that to the developers of the FLashCHat and see what sort of response you get.
And what a bout IE 6 and 7 - Some still use them too. ?
Why should people who create things adapt for those still living in the past and using software over 10 years old. ?
I used to do a lot of stuff that had to be modified for IE, opera and even chrome and at times for FF too.
Should programmers now have "Old" OS's and browser versions on hand just to test stuff for those who can't use IE7 or 8 any longer. - - - No mate - Let them use FF or something else. It's not as if there isn't an alternative.
IE6,7 and 8 are
"Dead"
It's time to move on.

jefazo666 [ Thu 15 Nov, 2012 09:47 ]
Post subject: Re: Chat Problem With Internet Explorer
I would like my website available too for people without money enough to renew their computers, and people without so much knowledge about computers. As a developer, my opinions is that services should be adapted to users, not users adapt to services.
TAke that to the developers of the FLashCHat and see what sort of response you get.
And what a bout IE 6 and 7 - Some still use them too. ?
Why should people who create things adapt for those still living in the past and using software over 10 years old. ?
I used to do a lot of stuff that had to be modified for IE, opera and even chrome and at times for FF too.
Should programmers now have "Old" OS's and browser versions on hand just to test stuff for those who can't use IE7 or 8 any longer. - - - No mate - Let them use FF or something else. It's not as if there isn't an alternative.
IE6,7 and 8 are
"Dead"
It's time to move on.

This is your opinion and theirs.
Mine is yet written. If you don't want to try to fix this, I can understand, but please let people who want, do it.
mort [ Thu 15 Nov, 2012 10:33 ]
Post subject: Re: Chat Problem With Internet Explorer
you wrote:
If I use IE in my website I get the same error,
but I works properly here at www.icyphoenix.com.
me wrote:
I think it's trying to tell you something that's it's not an Icy Phoenix problem.
People can please themselves what they get involved in trying to fix - But everyone needs a baseline starting point.
And the best baseline you could provide is to do a "virgin" install of IPv2.0 as something like "testsite" and then test the chat.
If it works that's fine - Then you could copy your existing Db, edit it and rename the path to testsite and test it with that.
If it still works - then you need to look at the changes you
may have made that causes the chat to fail, like adding other javascript, or modifying code.
The point I'm trying to make is, it's not working for you on your site but it does here, and that no one else seems to be having the same problem. Then you have to start with a fresh install of IP and work it up from there until something breaks. Other than that it's going to be mostly guesswork - and that doesn't really help at all.

Informpro [ Thu 15 Nov, 2012 10:48 ]
Post subject: Re: Chat Problem With Internet Explorer
Please try to replace
- submit.attr("disabled", ((text.val().trim() != "") || (focusState == "active")) ? false : true);
with
- if (!$.browser.msie || ($.browser.msie && Number($.browser.version) > 8)) submit.attr("disabled", ((text.val().trim() != "") || (focusState == "active")) ? false : true);
Very hacky, but should work.
jefazo666 [ Thu 15 Nov, 2012 11:40 ]
Post subject: Re: Chat Problem With Internet Explorer
Thanks for your answers.
Info that I wrote before:
There is not any change on the code by me. It's recently upgraded from 1.2.0.27c.
Also tried with clean install and the result is the same.
New Info:
Retested here the chat at Icy phoenix with IE8:
- No errors reported by IE if you are not logged in and Guest are allowed into the chat. But I can't write nothing, I think this is a result of the configuration of the board, guest are only allowed to view.
This has sense because the problem is the submit button and its properties, and when the guest are not allowed to write, there is no submit button.
- If I log in here at Icy Phoenix the problems it the same. Always with IE8.
Retested at my website:
- Same exact results (obvious, the code is the same). Error reported by IE only if I can see the submit button.
Retested again with clean Install at localhost
- Same exact results.
Next step will be try InformPro suggestion. Thanks InformPro
Edit: there is a better solution than this showed here.
Problem founded and solved:
IE <9 does not support the trim() messages applied to a string. At stack overflow founded the solution:
http://stackoverflow.com/questions/...t-working-in-ie
just add this code:
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
at the begining or out of any function, at ./templates/default/ajax_shoutbox_functions_js.tpl
and you will add the trim function to navigators that does not support it.
Just a bit of research from the developer and a lot of users with windows XP happy.
Thanks InformPro for the guide and mort for the same.
mort [ Thu 15 Nov, 2012 13:10 ]
Post subject: Re: Chat Problem With Internet Explorer
I did add another possibility for testing some of the functions - But it appears that you have solved it.
Well done - It's a credit to your ability and persistence.

jefazo666 [ Thu 15 Nov, 2012 13:18 ]
Post subject: Re: Chat Problem With Internet Explorer
I see that you edited your answer. Anyway I will explain this script:
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.
}
}
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().
mort [ Thu 15 Nov, 2012 23:12 ]
Post subject: Re: Chat Problem With Internet Explorer
Thanks for the link you posted as it highlighted the problem.
And particularly this from one observer.
Quote:
8 Get over it. All browsers have differences, you can't expect a browser to support features that were introduced in standards after it was released. – RobG Dec 22 '11 at 0:20
4 Sure I can, its called an update. – CountMurphy Jun 12 at 23:54
4 = The problem is that MS no longer support XP or IE8, so as things progress, there is no doubt more patches may need to be created to keep IE8 alive.
It's where to draw the line under trying to keep it alive it is the question. ?

jefazo666 [ Fri 16 Nov, 2012 02:43 ]
Post subject: Re: Chat Problem With Internet Explorer
Thanks for the link you posted as it highlighted the problem.
And particularly this from one observer.
Quote:
8 Get over it. All browsers have differences, you can't expect a browser to support features that were introduced in standards after it was released. – RobG Dec 22 '11 at 0:20
4 Sure I can, its called an update. – CountMurphy Jun 12 at 23:54
4 = The problem is that MS no longer support XP or IE8, so as things progress, there is no doubt more patches may need to be created to keep IE8 alive.
It's where to draw the line under trying to keep it alive it is the question. ?

42,5% of global users use WinXP
spydie [ Fri 16 Nov, 2012 08:53 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
but XP died aswell some time ago, if i´m not wrong
jefazo666 [ Fri 16 Nov, 2012 12:47 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
but XP died aswell some time ago, if i´m not wrong
What do you mean with died? If it is still installed in the 42% of the computers of the world, the 2nd OS most used, and has been beaten by win7 short time ago, for me this is not dead.
Dead is winMe or win98. But I think this is a question about opinions. Here I only wanted to allow these users who use XP to access the chat. I think this is not an insane idea. I agree with you that one day XP will be so hard to support, but for now, only changing 2 lines of code, does not seem difficult and with this simple work a lot of users can be happy. If you don't agree with this last line, I don't understand why.
I would like to clarify that I didn't came here for claim about the software or make any kind of demand of warranty. I only posted the problem and If anyone does not want to help, there is no problem.
For ending I insist in the question about the use of trim() sending messages. Is this for security reasons? I think is important to know, because without them fix would be easier and the trim seems is being done in another part of the code.
mort [ Fri 16 Nov, 2012 14:11 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
but XP died as well some time ago, if I'm not wrong
That is beside the point of what jefazo666 had to overcome.
And if I'm not wrong - And I usually am - - -
php - mysql trim() is server-side while javascript trim() is client-side so while javascript/ajax is moving along to do some of the processes that php and mysql normally does, IE8 doesn't get upgraded any longer to add any new javascript processes that comes along.
So all jefazo666 did was to patch, or upgrade IE8 if you wish so that it functions like the latest browsers do.
And as for XP dying some time ago - Vista died a hell of a lot faster as one of MS's worst ever OS's, Win7 wasn't much better and that's probably why there are still so many XP users.

jefazo666 [ Fri 16 Nov, 2012 14:34 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
In my opinion winxp keeps it 42% because some reasons:
- People does not know how to change.
- People does not like changes.
- Some user's computers have not hardware enough to support it or they will work slower with all w7 features. My girlfriend is an example of this.
- Winxp is installed in a lot of jobs offices and that users really don't care about upgrade it's computer or simply they are not allowed to do it.
This last reason makes me think that it is impossible that win7 has that 43% of Global users. Really I can't believe this is true, but that was the only study I founded (in spanish) made this year, so I will accept the data.
Mighty Gorgon [ Sat 17 Nov, 2012 14:27 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
I got a bit lost because of XP disquisition.
Can you tell me if your problem is solved or not?
mort [ Sun 18 Nov, 2012 11:52 ]
Post subject: Re: Chat Problem With Internet Explorer
Yeah, we did get carried away a little - or off-topic as it's generally known.
But in amongst the "Disquisition" =>
He fixed it here.
http://www.icyphoenix.com/viewtopic.php?p=57431#p57431
jhl [ Sun 18 Nov, 2012 16:09 ]
Post subject: Re: Chat Problem With Internet Explorer
Thanks for finding the problem - and the fix...
I see that you edited your answer. Anyway I will explain this script:
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.
}
}
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 did do fairly extensive testing, with multiple users, and I thought I had tested IE8 standards mode and quirks mode on XP, but that one obviously slipped through...
[Edit]
Since we're using jQuery, the simplest solution is to replace the two offending lines
with
[/Edit]
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().
The checkStatus() function is miscommented, it actually disables the submit button if there *is* a message - once the spaces have been removed. This is simply to stop the user resubmitting the message as Ajax is asynchronous. Once the message has been sent (and a reply given) the message is cleared and the button is re-enabled.
Thanks again,
John
Informpro [ Sun 18 Nov, 2012 17:12 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
Ajax is obviously asynchronous, that's its very meaning (the first A).
For trim, you should usually avoid to monkey patch base classes, but shiming is not a problem.
It's imho a better idea to add
- var p;
- (p = String.prototype).trim || (p.trim = function () { return this.replace(/^\s+|\s+$/g, ''); });
Than to edit everywhere ;). It should probably be included anyway
jhl [ Sun 18 Nov, 2012 18:14 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
Ajax is obviously asynchronous, that's its very meaning (the first A).
Beware old acronyms! Not necessarily asynchronous, nor XML, but still Javascript!
For trim, you should usually avoid to monkey patch base classes, but shiming is not a problem.
It's imho a better idea to add
- var p;
- (p = String.prototype).trim || (p.trim = function () { return this.replace(/^\s+|\s+$/g, ''); });
Than to edit everywhere ;). It should probably be included anyway
Why bother if there aready is a browser compatible library function? A little refactoring can't be that bad surely?
John
Informpro [ Sun 18 Nov, 2012 18:40 ]
Post subject: Re: [SOLVED] Chat Problem With Internet Explorer
Then you're using the wrong acronym :). Use SJAJson for synchronous javascript and json :p (or at least SJAX).
jefazo666 [ Mon 19 Nov, 2012 13:34 ]
Post subject: Re: Chat Problem With Internet Explorer
As I said before, I have no idea about AJAX, so I will trust you even if your advice is to put some fuel on server and throw fire on it.
As jhl said, changing the sintax of the trim and use Jquery is better solution, as we don't need to implement the trim function.
The final solution is here:
at line 665 from ./templates/default/ajax_shoutbox_functions_js.tpl
find
var text = inputText.val().trim();
change for
var text = $.trim(inputText.val());
at line 36 of ./templates/default/ajax_shoutbox_js.tpl
find
submit.attr("disabled", ((text.val().trim() != "") || (focusState == "active")) ? false : true);
change for
submit.attr("disabled", (($.trim(text.val()) != "") || (focusState == "active")) ? false : true);
don't use the prototype definition explained above.
jhl [ Tue 20 Nov, 2012 00:25 ]
Post subject: Re: Chat Problem With Internet Explorer
Exactly. I've sent a pull request to Luca (Mighty Gorgon) on github.
John
Joshua203 [ Tue 20 Nov, 2012 02:21 ]
Post subject: Re: Chat Problem With Internet Explorer
Should this be marked solved guys?
jefazo666 [ Tue 20 Nov, 2012 02:25 ]
Post subject: Re: Chat Problem With Internet Explorer
Should this be marked solved guys?
I don't know how many times I did it!
Did this changes if there is a new answer or something like that?

Joshua203 [ Tue 20 Nov, 2012 02:43 ]
Post subject: Re: Chat Problem With Internet Explorer
I don't think so... but thank you very much for marking it
EDIT:
No, after my post the solved tag stays

jhl [ Tue 20 Nov, 2012 19:15 ]
Post subject: Re: Chat Problem With Internet Explorer