[thelist] safe js

Manuel González Noriega manuel at simplelogica.net
Wed Mar 17 11:20:10 CST 2004

El mar, 16-03-2004 a las 15:30, Manuel González Noriega escribió:
> Hi all,
> Foreword: excuse my js newbieness :)

Ok, so i got zero answers, i'm gonna make a second and last try and then
i'll shut up, i promise :-)

if i got a link like this

<a href="foo.html" onclick="foo();return false;"
onkeypress="foo();return false;">


function foo() {

if (!document.getElementById) { return; }

// Blah, blah, blah...


1 Non js devices will use the foo.html page 
2 Modern browsers, js enabled will execute foo(), pass the
document.getElementById test and go along OK.
3. Old browsers with js enabled but failing the getElementById test,
won't do anything

So, i've got 1 and 2 covered nicely and need help with 3. Is there a way
i can make old browsers ignore the onclick and fallback to the href?


Manuel González Noriega
Simplelógica, construcción web  
    URL: http://simplelogica.net
    EMAIL: simplelogica at simplelogica.net
    TELEFONO: (+34) 985 22 12 65
Logicola es el weblog de Simplelógica http://simplelogica.net/logicola/
</p>That's right. We said Frontpage.</p>

More information about the thelist mailing list