elaJa new Javascript Framework

H

Henry

I have witten a Javascript Framework for the management of the
following web technologies: DOM, CSS, Events and Ajax

and this work has been published on sourceforge
at:http://sourceforge.net/projects/elajaframework

If interested, please try it and tell me what you think about it.
<snip>

Given that your code includes:-

| ELAJA.BrowserClass =
| {
| /*
| Function: w3cCompatible
|
| says if the browser is complied with w3c standards
|
| Visibility:
| - public
|
| Parameters:
| - void
|
| Returns:
| - true if the browser is a w3c complied browser (*boolean*)
| */
| w3cCompatible : function()
| {
| var r;
| r = document.all;
| if(typeof(r) == "undefined")
| return true;
| else
| return false;
| }
| }

- it might have been better to do something about learning how to
script web browsers before starting this. The number of W3C DOM
compatible browsers where - typeof document.all - is not 'undefined'
far exceeds the number where it is.
 
C

Chris Riesbeck

Henry said:
<snip>

Given that your code includes:-

| ELAJA.BrowserClass =
| {
| /*
| Function: w3cCompatible
|
| says if the browser is complied with w3c standards
|
| Visibility:
| - public
|
| Parameters:
| - void
|
| Returns:
| - true if the browser is a w3c complied browser (*boolean*)
| */
| w3cCompatible : function()
| {
| var r;
| r = document.all;
| if(typeof(r) == "undefined")
| return true;
| else
| return false;
| }
| }

- it might have been better to do something about learning how to
script web browsers before starting this. The number of W3C DOM
compatible browsers where - typeof document.all - is not 'undefined'
far exceeds the number where it is.

Besides the fact that it doesn't test for what the name says it does,
those 6 lines of code can be reduced to one:

return typeof(document.all) == "undefined"
 
T

thp1972

On Apr 9, 6:38 pm, (e-mail address removed) wrote:> I have witten a Javascript Framework for the management of the



<snip>

Given that your code includes:-

| ELAJA.BrowserClass =
| {
| /*
| Function: w3cCompatible
|
| says if the browser is complied with w3c standards
|
| Visibility:
| - public
|
| Parameters:
| - void
|
| Returns:
| - true if the browser is a w3c complied browser (*boolean*)
| */
| w3cCompatible : function()
| {
| var r;
| r = document.all;
| if(typeof(r) == "undefined")
| return true;
| else
| return false;
| }
| }

- it might have been better to do something about learning how to
script web browsers before starting this. The number of W3C DOM
compatible browsers where - typeof document.all - is not 'undefined'
far exceeds the number where it is.

Yes I agree, this was my first class I write and it has been designed
in a very poor way...
For the time being it must tell only if the user has IE or a W3C
compatible browser (Firefox...)
In the future I'll implement a Browser class that tell what browser
user are using and
I'll try to to that in a good way.

Thanks for the advice.
 
G

Gregor Kofler

(e-mail address removed) meinte:
Yes I agree, this was my first class I write and it has been designed
in a very poor way...
For the time being it must tell only if the user has IE or a W3C
compatible browser (Firefox...)
In the future I'll implement a Browser class that tell what browser
user are using and
I'll try to to that in a good way.

document.all is also supported by Opera, which is - IIRC - not precisely
the same thing as Internet Explorer. Your test is useless.
Forget about browser sniffing - this topic has been around in this NG
frequently. It won't work. Use feature testing instead.

Gregor
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
Besides the fact that it doesn't test for what the name says it does,
those 6 lines of code can be reduced to one:

return typeof(document.all) == "undefined"


Can that, in all browsers, be reduced to :

return !document.all ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top