[Javascript] Re: Javascript Digest, Vol 34, Issue 4

Kathrine Kugle kkugle at ksu.edu
Wed Dec 7 09:56:03 CST 2005


You should not be using the same name for an ID as for any other
element. IDs must be unique.




Quoting javascript-request at LaTech.edu:

> Send Javascript mailing list submissions to
> 	javascript at LaTech.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.LaTech.edu/mailman/listinfo/javascript
> or, via email, send a message with subject or body 'help' to
> 	javascript-request at LaTech.edu
>
> You can reach the person managing the list at
> 	javascript-owner at LaTech.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Javascript digest..."
>
>
> Today's Topics:
>
>    1. First Post etc. (Roderick A. Anderson)
>    2. window.onload questions (Schalk)
>    3. Re: window.onload questions (diego nunes)
>    4. Re: window.onload questions (Massimo Foti)
>    5. Re: window.onload questions (Nick Fitzsimons)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 05 Dec 2005 14:45:43 -0800
> From: "Roderick A. Anderson" <raanders at acm.org>
> Subject: [Javascript] First Post etc.
> To: javascript at LaTech.edu
> Message-ID: <4394C317.1050101 at acm.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> This is a test also.  I expected more traffic adn I've got none since
> I
> signed up mid-morning.
>
> The reason I joined is two fold.  First I'm getting ready to write a
> serious bit of Javascript for some specialized form validation.
> Currently I use fValidate for most of it but Peter seems to have
> fallen
> off the face of the earth.
>
> Secondly is an issue that a friend mentioned he found that only
> happens
> with IE ( go figure eh :-) and we can't find any mention of when
> searching with google.
>
> The short story is:  When a name attribute exists with the same value
> as
> a id attribute in a document and comes first in the DOM; Internet
> Explorer returns the element with the name instead of element with
> the
> id when getElementById is used.
>
> A simple and lame example:
>
> <html>
>    <head>
>      ...
>    </head>
>    <body>
>      ...
>      <div name="testing">
>        ...
>      </div>
>      ...
>      ...
>      <input type="text" id="testing" />
>
>      ...
>    </body>
> </html>
>
> The div gets returned.
>
> I have yet to test this but I trust my friend's programming skills.
>
> Anyone else seen this?
>
>
> Rod
> --
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 06 Dec 2005 16:02:50 +0200
> From: Schalk <schalk at volume4.com>
> Subject: [Javascript] window.onload questions
> To: "[JavaScript List]" <javascript at LaTech.edu>
> Message-ID: <43959A0A.7080503 at volume4.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Greetings All
>
> I have two seperate .js file that I load into a html page. Both of
> them
> load their init() function with the window.onload function. From what
> I
> can see it seems that the second script is overriding the first
> script
> and the first one is never run and therefore does not function.
>
> First, can I call the onload functions of both in the second script,
> even though they are in seperate files? If not, is it best then to
> merge
> the two into one file or do I have another option? Thanks for all of
> your input.
>
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 6 Dec 2005 13:15:19 -0200
> From: diego nunes <dnunes at gmail.com>
> Subject: Re: [Javascript] window.onload questions
> To: "[JavaScript List]" <javascript at latech.edu>
> Message-ID: <14f57d420512060715t1dec20a0u at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 06/12/05, Schalk <schalk at volume4.com> wrote:
> > Can I call the onload functions of both in the second script,
> > even though they are in seperate files? If not, is it best then to
> merge
> > the two into one file or do I have another option?
>
>     You can call two function in an onload event, and you can call
> both functions from the second file with no problems, but cannot have
> two functions with the same name. If you can, it's clearly better to
> merge both functions into one; otherwise, try changing the name of
> one
> of the functions, and calling them the way you judge better.
>
>   Amplexos.
>
>
> --
> diego nunes
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 6 Dec 2005 16:05:22 +0100
> From: "Massimo Foti" <massimo at amila.ch>
> Subject: Re: [Javascript] window.onload questions
> To: "[JavaScript List]" <javascript at LaTech.edu>
> Message-ID: <003501c5fa76$7bec5d20$2301a8c0 at Massimo2000>
> Content-Type: text/plain;	charset="iso-8859-1"
>
> > I have two seperate .js file that I load into a html page. Both of
> them
> > load their init() function with the window.onload function. From
> what I
> > can see it seems that the second script is overriding the first
> script
> > and the first one is never run and therefore does not function.
> >
> > First, can I call the onload functions of both in the second
> script,
> > even though they are in seperate files? If not, is it best then to
> merge
> > the two into one file or do I have another option? Thanks for all
> of
> > your input.
>
>
http://www.sitepoint.com/blogs/2004/05/26/closures-and-executing-javascript-
> on-page-load/
>
> ----------------------------
> Massimo Foti
> Tools for ColdFusion and Dreamweaver developers:
> http://www.massimocorner.com
> ----------------------------
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 6 Dec 2005 15:19:45 -0000 (GMT)
> From: "Nick Fitzsimons" <nick at nickfitz.co.uk>
> Subject: Re: [Javascript] window.onload questions
> To: "\[JavaScript List\]" <javascript at LaTech.edu>
> Message-ID:
> 	<49278.193.195.164.58.1133882385.squirrel at www.easilymail.co.uk>
> Content-Type: text/plain;charset=iso-8859-1
>
> > Greetings All
> >
> > I have two seperate .js file that I load into a html page. Both of
> them
> > load their init() function with the window.onload function. From
> what I
> > can see it seems that the second script is overriding the first
> script
> > and the first one is never run and therefore does not function.
> >
> > First, can I call the onload functions of both in the second
> script,
> > even though they are in seperate files? If not, is it best then to
> merge
> > the two into one file or do I have another option? Thanks for all
> of
> > your input.
> >
>
> You can semi-automate the process using Simon Willison's addLoadEvent
> function; it's described at
> <http://simon.incutio.com/archive/2004/05/26/> and he goes into more
> detail at
>
<http://www.sitepoint.com/blogs/2004/05/26/closures-and-executing-javascript-on-page-load/>
>
> HTH,
>
> Nick.
> --
> Nick Fitzsimons
> http://www.nickfitz.co.uk/
>
>
>
> ------------------------------
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
> End of Javascript Digest, Vol 34, Issue 4
> *****************************************
>
>



More information about the Javascript mailing list