Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #18435
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Script in <a > tag in IE |
| Date | 2013-02-10 20:38 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <kf8svv$sil$1@speranza.aioe.org> (permalink) |
| References | (4 earlier) <8809769.VO6lmAGIsZ@PointedEars.de> <kf6p3g$acq$1@speranza.aioe.org> <2710705.sg4g0aCLjx@PointedEars.de> <kf6qf9$dej$1@speranza.aioe.org> <1522652.FLkxLQDhY3@PointedEars.de> |
W dniu 2013-02-10 13:55, Thomas 'PointedEars' Lahn pisze:
> Cezary Tomczyk wrote:
>
>> W dniu 2013-02-10 01:27, Thomas 'PointedEars' Lahn pisze:
>>> Cezary Tomczyk wrote:
[...]
>>>> You have not said why.
>>> True, because we have been over this ad nauseam here already.
>>
>> Hm, it would maybe good to collect all results of previous discussions
>> somewhere in FAQ place, you know. I know that writing the same things
>> over and over again is a maybe little bit waste of time.
>
> Yes. Thank you for your volunteering.
:-) I have created a site based on MediaWiki:
http://faq.jscode.info/index.php/Main_Page
If this can helps then site could be improved by adding new contributors
and content. Otherwise just say: "Not this time" :-)
>> But on the other hand answer like "Utter nonsense, all of the above."
>> doesn't contains useful informations. Just make more confuses.
>
> You can find indication that it is utter nonsense when you evaluate the
> truth value of the statement “HTML files […] by using inline events […] are
> not cached”. The fact aside that there are no “inline events” (there are
> event-handler attributes on elements, many of them defined in HTML
> Specifications HTML 4.01 [REC] and HTML5 [CR]): *Why* would such a document
> _not_ be cached by an HTTP client?
Sorry, I went to far. HTML files may of course be cached. I probably had
some delusions. :-)
>> Could be written like this:
>>
>> var doAction = function () {
>> addAttachments();
>> return false;
>> };
>>
>> var m = function () {
>> var a = document.getElementById('mylinkelement');
>> a.onclick = doAction;
>> };
>>
>> m();
>
> Could be, but should not.
More or less I agree.
>> But let's leave it as is and close this case.
>
> This is not a matter of opinion. There are good reasons why this is harder
> to maintain bloat code – directly contradicting your thesis that the
> separation would make a smaller footprint and would make things easier –,
> and there are few if any reasons why it is not. You can see that when you
> count the number of characters required for implementing either approach.
> You can see it again when you calculate the code distance in either case.
> You can see it yet again when you consider the compatibility of either
> approach.
Well, I never use event-handler attributes on elements. Just separate
behaviours and logic. For me is just easier for maintenance.
Another thing is when user has no JavaScript* (for whatever reason) then
HTML code is just slightly bigger to download. Not maybe big difference,
but it is. Because contains event-handler attributes which will not be
used when JavaScript is not available.
I wouldn't worry so much about some few kilobytes more in JavaScript
files. There is more important in my opinion problems like: too much
requests to server (files are not combined into one file, a lot of
requests for some data, etc.), not efficient code, files not cached, etc.
> Your approach can be useful – if augmented – if the same functionality is
> needed in several places and the event does not bubble. Which is not the
> case here.
Hm, this topic should be also in FAQ: "When and when not to use
event-handler attributes?".
>>>> Also, I provided links that contains explanations "why not inline
>>>> events". You do not have to agree with them.
>>> I do not, because they are utter nonsense.
>>
>> Without any evidences I can not say that you have right. Anyway, let's
>> leave it as is.
>
> No, truth must be told, and you have not thought this through.
Unfortunately, I like evidences instead of trusting :-) Descriptions
(articles or something similar) that are convincing or examples that works.
* There is no "JavaScript", I know.
--
Cezary Tomczyk
http://www.ctomczyk.pl/
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Script in <a > tag in IE Tim Slattery <Slattery_T@bls.gov> - 2013-02-07 14:32 -0500
Re: Script in <a > tag in IE "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-07 20:47 +0100
Re: Script in <a > tag in IE Tim Slattery <Slattery_T@bls.gov> - 2013-02-07 15:08 -0500
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-07 21:20 +0100
Re: Script in <a > tag in IE SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-09 16:42 +0100
Re: Script in <a > tag in IE Tim Streater <timstreater@greenbee.net> - 2013-02-07 21:30 +0000
Re: Script in <a > tag in IE Denis McMahon <denismfmcmahon@gmail.com> - 2013-02-08 07:08 +0000
Re: Script in <a > tag in IE Christoph Becker <cmbecker69@gmx.de> - 2013-02-08 16:30 +0100
Re: Script in <a > tag in IE Tim Streater <timstreater@greenbee.net> - 2013-02-08 15:41 +0000
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-07 21:02 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-09 00:19 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-09 00:25 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-09 14:35 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-09 22:27 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-09 20:33 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 00:08 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-10 00:52 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 01:07 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-10 01:20 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 01:27 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-10 01:43 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 13:55 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-10 20:38 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 21:28 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-10 21:37 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-10 22:56 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-11 00:09 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-11 00:30 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-11 00:43 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 01:02 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-11 01:16 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 01:49 +0100
Re: Script in <a > tag in IE Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-11 17:59 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 18:19 +0100
Re: Script in <a > tag in IE Scott Sauyet <scott.sauyet@gmail.com> - 2013-02-11 13:03 -0800
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 22:09 +0100
Re: Script in <a > tag in IE Scott Sauyet <scott.sauyet@gmail.com> - 2013-02-11 13:59 -0800
Re: Script in <a > tag in IE "Richard Cornford" <Richard@litotes.demon.co.uk> - 2013-02-18 00:15 +0000
Re: Script in <a > tag in IE Scott Sauyet <scott.sauyet@gmail.com> - 2013-02-21 12:33 -0800
Re: Script in <a > tag in IE "Richard Cornford" <Richard@litotes.demon.co.uk> - 2013-02-22 00:59 +0000
Re: Script in <a > tag in IE Scott Sauyet <scott.sauyet@gmail.com> - 2013-02-23 07:54 -0800
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-22 02:00 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-22 01:12 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 01:38 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 00:48 +0100
Re: Script in <a > tag in IE Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-11 01:09 +0100
Re: Script in <a > tag in IE Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-02-20 00:07 +0100
Re: Script in <a > tag in IE dhtml <dhtmlkitchen@gmail.com> - 2013-02-11 07:30 -0800
csiph-web