HighDots Forums  

Another AJAX question

Javascript JavaScript language (comp.lang.javascript)


Discuss Another AJAX question in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Jorge
 
Posts: n/a

Default Re: Another AJAX question - 06-08-2008 , 03:21 PM






On Jun 8, 6:19*pm, Dr J R Stockton <j... (AT) merlyn (DOT) demon.co.uk> wrote:
Quote:
Or
* * s.display = (txt.charAt(0) === "0") ? 'none' : ''; *// untested

Or

s.display = (txt[0] === "0") ? 'none' : '';
// tested in Safari, FF and Opera.

/8¬)

--Jorge.


Reply With Quote
  #22  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Another AJAX question - 06-08-2008 , 04:37 PM






Jorge wrote:
Quote:
On Jun 8, 6:19 pm, Dr J R Stockton <j... (AT) merlyn (DOT) demon.co.uk> wrote:
Or
s.display = (txt.charAt(0) === "0") ? 'none' : ''; // untested

Or

s.display = (txt[0] === "0") ? 'none' : '';
// tested in Safari, FF and Opera.
The possibility of accessing string values as if they were an array of
characters is a proprietary extension of ECMAScript that should not be
relied on. It does not work in IE/MSHTML, for example, which makes it
rather not viable on the Web. (I should add that feature to the ES Matrix.)

However, when necessary it is easy to make an array of characters out of a
string: txt.split("").


F'up2 cljs

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee


Reply With Quote
  #23  
Old   
Jorge
 
Posts: n/a

Default Re: Another AJAX question - 06-09-2008 , 10:46 AM



On Jun 8, 11:37*pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
(...) txt[0] === "0" (...)
(...) does not work in IE/MSHTML, for example, (...)
"for example" ?

ROTFLOL... how come... IE *again*, one more time ?

Math.pow(LOL, 16384);

--Jorge.


Reply With Quote
  #24  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Another AJAX question - 06-09-2008 , 12:42 PM



Jorge wrote:
Quote:
Thomas 'PointedEars' Lahn wrote:
(...) txt[0] === "0" (...)
(...) does not work in IE/MSHTML, for example, (...)

"for example" ?
Since this is a proprietary extension to the ECMAScript Language
Specification, it is possible that there is more than one implementation of
it that does not provide the feature.

Quote:
ROTFLOL... how come... IE *again*, one more time ?
Microsoft JScript does not provide this language feature.

Quote:
Math.pow(LOL, 16384);
Didn't you mean to say

Math.pow(LOL, Math.pow(2, 14));

? I also wonder about the value of LOL.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16


Reply With Quote
  #25  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: Another AJAX question - 06-10-2008 , 10:16 AM



In comp.lang.javascript message <1cc2d6f2-33dc-4e5b-9633-9bec28efc120@l4
2g2000hsc.googlegroups.com>, Sun, 8 Jun 2008 13:21:56, Jorge
<jorge (AT) jorgechamorro (DOT) com> posted:
Quote:
s.display = (txt[0] === "0") ? 'none' : '';
// tested in Safari, FF and Opera.

Only when writing for a rigorously-controlled intranet can it be safe to
omit testing in MS IE.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
Via <URL:http://support.codegear.com/newsgroups/>: news:borland.* Guidelines


Reply With Quote
  #26  
Old   
Michael Wojcik
 
Posts: n/a

Default Re: Another AJAX question - 06-11-2008 , 11:21 AM



[Followups restricted to c.l.j.]

Dr J R Stockton wrote:
Quote:
In comp.lang.javascript message <1cc2d6f2-33dc-4e5b-9633-9bec28efc120@l4
2g2000hsc.googlegroups.com>, Sun, 8 Jun 2008 13:21:56, Jorge
jorge (AT) jorgechamorro (DOT) com> posted:
s.display = (txt[0] === "0") ? 'none' : '';
// tested in Safari, FF and Opera.

Only when writing for a rigorously-controlled intranet can it be safe to
omit testing in MS IE.
What about Greasemonkey scripts? What about Yahoo Widgets? What about
ECMAScript programs, in short, that are written specifically to run
under a particular implementation?

That implementation may even be a browser, for that matter; I've
written ECMAScript applications that are only supported under the
Mozilla engine. You want to run them, you run them under a Mozilla
derivative. There's no compelling need for me to make them run under
other implementations, any more than I have a need to stick to ISO C
for all of my C applications.

I'd agree that when writing scripts for general use, testing under
Microsoft's implementation is advisable, but "a rigorously-controlled
intranet" is hardly the only alternative to "general use".

Sometimes the c.l.j regulars - excellent though much of their advice
may be - appear to forget that there are uses for ECMAScript other
than scripting general-use web pages.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University


Reply With Quote
  #27  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Another AJAX question - 06-12-2008 , 04:25 PM



Michael Wojcik wrote:
Quote:
Dr J R Stockton wrote:
In comp.lang.javascript message
1cc2d6f2-33dc-4e5b-9633-9bec28efc120@l4 2g2000hsc.googlegroups.com>,
Sun, 8 Jun 2008 13:21:56, Jorge <jorge (AT) jorgechamorro (DOT) com> posted:
s.display = (txt[0] === "0") ? 'none' : ''; // tested in Safari, FF
and Opera.
Only when writing for a rigorously-controlled intranet can it be safe
to omit testing in MS IE.

What about Greasemonkey scripts? What about Yahoo Widgets? What about
ECMAScript programs, in short, that are written specifically to run under
a particular implementation?
ACK for Greasemonkey scripts. But are Yahoo widgets really written
specifically to run under a particular implementation?

Quote:
That implementation may even be a browser,
A Web browser is not an ECMAScript implementation; it may provide one.

Quote:
for that matter; I've written ECMAScript applications that are only
supported under the Mozilla engine. You want to run them, you run them
under a Mozilla derivative.
More specifically, you are required to have XUL support before being able to
run them. At least that is the only justification for this restriction that
I could accept.

Quote:
There's no compelling need for me to make them run under other
implementations, any more than I have a need to stick to ISO C for all of
my C applications.
True, but this thread was about something else.

Quote:
I'd agree that when writing scripts for general use, testing under
Microsoft's implementation is advisable, but "a rigorously-controlled
intranet" is hardly the only alternative to "general use".
True, because even an intranet that is seemingly "rigorously controlled" now
does not need to be so later. IMHO, the competent developer would attempt
to cover as many possibilities of access as possible; that is, they do not
exclude any in the first place, especially not when it is probable to occur.

Quote:
Sometimes the c.l.j regulars - excellent though much of their advice may
be - appear to forget that there are uses for ECMAScript other than
scripting general-use web pages.
Sometimes it is necessary to point out that a suggested feature is not
universally available. AFAICS, this thread was about "AJAX" in HTML user
agents in general and so the remarks regarding differences in
implementations were justified.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7 (AT) news (DOT) demon.co.uk>


Reply With Quote
  #28  
Old   
Michael Wojcik
 
Posts: n/a

Default Re: Another AJAX question - 06-13-2008 , 02:38 PM



Thomas 'PointedEars' Lahn wrote:
Quote:
Michael Wojcik wrote:
Dr J R Stockton wrote:
In comp.lang.javascript message
1cc2d6f2-33dc-4e5b-9633-9bec28efc120@l4 2g2000hsc.googlegroups.com>,
Sun, 8 Jun 2008 13:21:56, Jorge <jorge (AT) jorgechamorro (DOT) com> posted:
s.display = (txt[0] === "0") ? 'none' : ''; // tested in Safari, FF
and Opera.
Only when writing for a rigorously-controlled intranet can it be safe
to omit testing in MS IE.
What about Greasemonkey scripts? What about Yahoo Widgets? What about
ECMAScript programs, in short, that are written specifically to run under
a particular implementation?

ACK for Greasemonkey scripts. But are Yahoo widgets really written
specifically to run under a particular implementation?
Yes - they run under Konfabulator. Are we talking about the same thing?

Quote:
That implementation may even be a browser,

A Web browser is not an ECMAScript implementation; it may provide one.
Right. Sloppy phrasing on my part.

Quote:
for that matter; I've written ECMAScript applications that are only
supported under the Mozilla engine. You want to run them, you run them
under a Mozilla derivative.

More specifically, you are required to have XUL support before being able to
run them. At least that is the only justification for this restriction that
I could accept.
You're not required to accept my justification - which is that if I'm
writing an application to solve some problem of interest to me, I may
or may not be interested in making it cross-implementation compatible.

I have been working on an application for my own purposes which
happens to be written in ECMAScript. Some people have expressed
interest in it, and that's fine, but they'll have to run it in the
same implementation I use, or they'll have to port it themselves.
Making it run everywhere is not one of my goals.

Quote:
There's no compelling need for me to make them run under other
implementations, any more than I have a need to stick to ISO C for all of
my C applications.

True, but this thread was about something else.
This subthread - starting with my reply to the good doctor - is about
when it is advisable to test ECMAScript programs under IE.

Quote:
Sometimes it is necessary to point out that a suggested feature is not
universally available. AFAICS, this thread was about "AJAX" in HTML user
agents in general and so the remarks regarding differences in
implementations were justified.
Such remarks are nearly always justified, in my opinion. When those
remarks include absolutes like the "Only when..." above, however, they
need to be qualified. You can certainly argue (as you did) that a
suitable qualification was implicit in the context; I thought it
better to make one explicit.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.