Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32796

Re: Javascript seems to be giving different answers on some devices

Newsgroups comp.lang.javascript
Subject Re: Javascript seems to be giving different answers on some devices
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <66c91c1e-3166-49a2-b6a1-13cb1b0aeb4a@googlegroups.com>
Date 2017-03-18 14:33 +0100
Message-ID <XnsA73C9411FE7EEeejj99@194.109.6.166> (permalink)

Show all headers | View raw


tadamsmar@gmail.com wrote on 18 Mar 2017 in comp.lang.javascript:

> I have an app here:
> 
> http://www.poologic.com/poolcalc/Poolcalc.html
> 
> You have to hit the Calculate Now button to see the bug.
> 
> One user is reporting that it shows Dayton instead of Wichita St in the
> lower right (above Kentucky).  It should show Wichita St. 
> 
> The javascript is generated by GWT 2.6.1. 

???

> That's an old version, but I
> am not sure that has anything to do with the problem.  All devices
> should be running the same javascript. 

Well, Javascript is NOT a 'script of Java', so:
 
'Javascript' is the programming language,
the 'javascript-engine' is [here] the clientside interpreter,
the 'javascript-script' is the script code.

Do you mean:
"All devices should be running the same javascript-script." ?


> He saw the bug on an Iphone 7+ and 6+ and he tested Chrome.  I think he
> also test Safari. 

The Javascript source is not humanly-readable, but I expect the bug is in 
this 'javascript-script', if it acts as you describe.
 
> But I tested on an Iphone 5s and it works properly on Safari and Chrome.
>  Also works on all our other devices (older Ipad, Windows 10, Windows
> 7). 

"Properly" as in "the way I want it"?

> I am stumped. 

I am not.

The joy [or the curse, depending on your point of view] of clientside 
Javascript, is that it runs on different 'javascript-engines' so you should 
optimalize for all the engines you want the script to run.

As this seems to be a very old script, the programmer could not test it on 
the more modern ones.

So, it stands to reason that unexpected behavour can be expected.

Some internal functions could have different definitions in more modern 
versions, or the whole script could have been designed for 'jscript' 
[meaning M-soft-Javascript].

> I don't see how it could be a caching problem because I
> am sure I never put a version of the program on the web that would show
> Dayton. 

Eh, did you change the script recently?

Well, catching can easily be avoided by testing on the neighbour's machine,
certainly not just by naming your js-file "hello.nocache.js".


I would suggest you rewrite your script in humanly-readable code,
and then have us have a look.

PS: if you do not want to have to bother with different execution-engines,
use serverside-programming, as I doubt it poses a heavy load on your server.

Serverside-javascript is on-topic here.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Javascript seems to be giving different answers on some devices tadamsmar@gmail.com - 2017-03-18 05:57 -0700
  Re: Javascript seems to be giving different answers on some devices Julio Di Egidio <julio@diegidio.name> - 2017-03-18 06:11 -0700
    Re: Javascript seems to be giving different answers on some devices Tom Adams <tadamsmar@gmail.com> - 2017-03-18 06:50 -0700
  Re: Javascript seems to be giving different answers on some devices "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-18 14:33 +0100
    Re: Javascript seems to be giving different answers on some devices Tom Adams <tadamsmar@gmail.com> - 2017-03-18 06:48 -0700
      Re: Javascript seems to be giving different answers on some devices "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-18 15:13 +0100
    Re: Javascript seems to be giving different answers on some devices Tom Adams <tadamsmar@gmail.com> - 2017-03-18 06:52 -0700
      Re: Javascript seems to be giving different answers on some devices "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-18 14:58 +0100
        Re: Javascript seems to be giving different answers on some devices Tom Adams <tadamsmar@gmail.com> - 2017-03-18 09:08 -0700
          Re: Javascript seems to be giving different answers on some devices "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-18 18:34 +0100
            Re: Javascript seems to be giving different answers on some devices Tom Adams <tadamsmar@gmail.com> - 2017-03-18 10:39 -0700
              Re: Javascript seems to be giving different answers on some devices "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-18 21:13 +0100

csiph-web