In the current version of phpMyChat, Javascript has been used to determine whether the version which version of phpMyChat can be loaded. This method is okay if the start form is loaded.
However, if I were to bypass the form, say via Get method, I will need to find an alternative method to determine the Javascript capability.
The PHPClientSniffer class seems to do the job, allowing the client side to find the javascript capability of the browser and hence determine the Ver to launch automatically: http://sourceforge.net/projects/phpsniff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I do not like the way client sniffers works because:
1) even if a browser support a certain version of javascript, the user may have disabled it;
2) you need to update the sniffer code each time a new browser or a new browser revision is released.
BTW, you can define a valid link (GET method) to phpMyChat even if it's a bit difficult. In your html page, you should use:
....
<script type="text/javascript" language="javascript">
var jsIsIE4 = ((typeof(document.all) != 'undefined') && (parseInt(navigator.appVersion) >= 4)) ? 1 : 0;
var jsIsNS4 = (typeof(document.layers) != 'undefined') ? 1 : 0;
var jsIsJs11 = (typeof(window.focus) != 'undefined');
if (jsIsIE4 || jsIsNS4) {
document.write('<a href.... the link to high version ...</a>');
}
else if (jsIsJs11) {
document.write('<a href.... the link to medium version ...</a>');
}
else {
document.write('<a href.... the link to low version ...</a>');
}
</script>
<noscript>
<a href.... the link to low version ...</a>
</noscript>
Hope that helps,
Loc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-05-26
Hi Loic,
Thanks for the information.
I tested phpMyChat on the IE4.01 Mac Version..
currently, phpMyChat loads the high version for it. However, phpMyChat cannot seem to work with Ver=H. This is probably due to the "scroll(0, 65000)" javascript function. Consequently, I tried $Ver=M, it seems alright.
Probably when might need to check for (IE4 and OS!=Mac) in the javascript detection script before loading ver=H
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the current version of phpMyChat, Javascript has been used to determine whether the version which version of phpMyChat can be loaded. This method is okay if the start form is loaded.
However, if I were to bypass the form, say via Get method, I will need to find an alternative method to determine the Javascript capability.
The PHPClientSniffer class seems to do the job, allowing the client side to find the javascript capability of the browser and hence determine the Ver to launch automatically:
http://sourceforge.net/projects/phpsniff
Hi Maskie!
Well, I do not like the way client sniffers works because:
1) even if a browser support a certain version of javascript, the user may have disabled it;
2) you need to update the sniffer code each time a new browser or a new browser revision is released.
BTW, you can define a valid link (GET method) to phpMyChat even if it's a bit difficult. In your html page, you should use:
....
<script type="text/javascript" language="javascript">
var jsIsIE4 = ((typeof(document.all) != 'undefined') && (parseInt(navigator.appVersion) >= 4)) ? 1 : 0;
var jsIsNS4 = (typeof(document.layers) != 'undefined') ? 1 : 0;
var jsIsJs11 = (typeof(window.focus) != 'undefined');
if (jsIsIE4 || jsIsNS4) {
document.write('<a href.... the link to high version ...</a>');
}
else if (jsIsJs11) {
document.write('<a href.... the link to medium version ...</a>');
}
else {
document.write('<a href.... the link to low version ...</a>');
}
</script>
<noscript>
<a href.... the link to low version ...</a>
</noscript>
Hope that helps,
Loc
Hi Loic,
Thanks for the information.
I tested phpMyChat on the IE4.01 Mac Version..
currently, phpMyChat loads the high version for it. However, phpMyChat cannot seem to work with Ver=H. This is probably due to the "scroll(0, 65000)" javascript function. Consequently, I tried $Ver=M, it seems alright.
Probably when might need to check for (IE4 and OS!=Mac) in the javascript detection script before loading ver=H