shortcut for document.getElementById and some error
- From: "HopfZ" <hopfzeta@xxxxxxxxx>
- Date: 30 Jun 2006 08:57:09 -0700
I made two shortcut functions for document.getElementById as:
function EBI2(id){return document.getElementById(id)};
var EBI3 = document.getElementById;
But EBI3 don't work.
EBI2('myText'); //works
EBI3('myText'); //unexpected error
The error message for EBI3 according to Firebug Firefox(1.5.0.4)
extension is:
uncaught exception: [Exception... "Illegal operation on WrappedNative
prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: javascript:
with (FireBugEval.api) { with (window) {
FireBugEval(eval(FireBugEval.expr)) }} :: <TOP_LEVEL> :: line 1" data:
no]
Is EBI3 a bad way?
.
- Follow-Ups:
- Re: shortcut for document.getElementById and some error
- From: Evertjan.
- Re: shortcut for document.getElementById and some error
- From: Randy Webb
- Re: shortcut for document.getElementById and some error
- From: Martin Honnen
- Re: shortcut for document.getElementById and some error
- Prev by Date: Re: Need help with simple progress bar
- Next by Date: Re: Need help with simple progress bar
- Previous by thread: Need help with simple progress bar
- Next by thread: Re: shortcut for document.getElementById and some error
- Index(es):