Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #24170 > unrolled thread
| Started by | "Sithu.D" <zebra05@gmail.com> |
|---|---|
| First post | 2014-05-15 02:32 -0700 |
| Last post | 2014-05-16 09:49 +0100 |
| Articles | 9 — 6 participants |
Back to article view | Back to comp.lang.javascript
Detection of devices using JavaScript "Sithu.D" <zebra05@gmail.com> - 2014-05-15 02:32 -0700
Re: Detection of devices using JavaScript Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-15 16:27 +0000
Re: Detection of devices using JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-15 18:40 +0200
Re: Detection of devices using JavaScript Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-15 19:20 +0200
Re: Detection of devices using JavaScript "Sithu.D" <zebra05@gmail.com> - 2014-05-15 23:56 -0700
Re: Detection of devices using JavaScript Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-16 13:03 +0200
Re: Detection of devices using JavaScript Simon Lewis <simonlewis2001@gmail.com> - 2014-05-16 15:14 +0200
Re: Detection of devices using JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-16 15:46 +0200
Re: Detection of devices using JavaScript John Harris <niam@jghnorth.org.uk.invalid> - 2014-05-16 09:49 +0100
| From | "Sithu.D" <zebra05@gmail.com> |
|---|---|
| Date | 2014-05-15 02:32 -0700 |
| Subject | Detection of devices using JavaScript |
| Message-ID | <be99109d-a09b-4374-bd4d-68c746d3405d@googlegroups.com> |
Hi everyone, I need to find a way to detect the type of device and os calling an API using JavaScript. I preferable need to do this in some way more reliable than detecting the User Agent. Any ideas please? Thanks, Sithu.D
[toc] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2014-05-15 16:27 +0000 |
| Message-ID | <ll2ptp$bep$1@dont-email.me> |
| In reply to | #24170 |
On Thu, 15 May 2014 02:32:25 -0700, Sithu.D wrote: > I need to find a way to detect the type of device and os calling an API > using JavaScript. I preferable need to do this in some way more reliable > than detecting the User Agent. Any ideas please? Is this javascript operating inside a web browser, or is it a script interpreter embedded in some other application? -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-05-15 18:40 +0200 |
| Message-ID | <2757558.IxYUr6dfcW@PointedEars.de> |
| In reply to | #24171 |
Denis McMahon wrote: > On Thu, 15 May 2014 02:32:25 -0700, Sithu.D wrote: >> I need to find a way to detect the type of device and os calling an API >> using JavaScript. I preferable need to do this in some way more reliable >> than detecting the User Agent. Any ideas please? > > Is this javascript operating inside a web browser, or is it a script There is no javascript. <http://PointedEars.de/es-matrix> > interpreter embedded in some other application? More important: Why? In most cases the need to “detect the type of device and os” is only a need perceived because of lack of experience, not an actual need. -- PointedEars FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix> Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2014-05-15 19:20 +0200 |
| Message-ID | <5374f76d$0$6664$9b4e6d93@newsspool3.arcor-online.net> |
| In reply to | #24172 |
Thomas 'PointedEars' Lahn wrote: > Denis McMahon wrote: > >> On Thu, 15 May 2014 02:32:25 -0700, Sithu.D wrote: >>> I need to find a way to detect the type of device and os calling an API >>> using JavaScript. I preferable need to do this in some way more reliable >>> than detecting the User Agent. Any ideas please? >> >> Is this javascript operating inside a web browser, or is it a script > > There is no javascript. <http://PointedEars.de/es-matrix> ACK >> interpreter embedded in some other application? As the OP mentioned that he would prefer something more reliable than detecting the User Agent, it's likely that they were asking about browser side scripting. > More important: Why? > > In most cases the need to “detect the type of device and os” is only a need > perceived because of lack of experience, not an actual need. ACK (at least wrt. to browser side scripting). -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | "Sithu.D" <zebra05@gmail.com> |
|---|---|
| Date | 2014-05-15 23:56 -0700 |
| Message-ID | <99395878-fe47-4f8d-986e-b10a4e9ae636@googlegroups.com> |
| In reply to | #24173 |
On Thursday, May 15, 2014 7:20:53 PM UTC+2, Christoph Michael Becker wrote: > Thomas 'PointedEars' Lahn wrote: > > > > > Denis McMahon wrote: > > > > > >> On Thu, 15 May 2014 02:32:25 -0700, Sithu.D wrote: > > >>> I need to find a way to detect the type of device and os calling an API > > >>> using JavaScript. I preferable need to do this in some way more reliable > > >>> than detecting the User Agent. Any ideas please? > > >> > > >> Is this javascript operating inside a web browser, or is it a script > > > > > > There is no javascript. <http://PointedEars.de/es-matrix> > > > > ACK > > > > >> interpreter embedded in some other application? > > > > As the OP mentioned that he would prefer something more reliable than > > detecting the User Agent, it's likely that they were asking about > > browser side scripting. > > > > > More important: Why? > > > > > > In most cases the need to "detect the type of device and os" is only a need > > > perceived because of lack of experience, not an actual need. > > > > ACK (at least wrt. to browser side scripting). > > > > -- > > Christoph M. Becker Thanks, Christoph. It turns out all that I need is a regex pattern to search the User Agent after all. I got conflicting requirements. The real idea is to detect a mobile device on a website and then show the user an app download page. Kind regards.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2014-05-16 13:03 +0200 |
| Message-ID | <5375f07e$0$6699$9b4e6d93@newsspool2.arcor-online.net> |
| In reply to | #24180 |
Sithu.D wrote: > On Thursday, May 15, 2014 7:20:53 PM UTC+2, Christoph Michael Becker > wrote: > >> Thomas 'PointedEars' Lahn wrote: >> >>> In most cases the need to "detect the type of device and os" is >>> only a need >> >>> perceived because of lack of experience, not an actual need. >> >> ACK (at least wrt. to browser side scripting). > > Thanks, Christoph. It turns out all that I need is a regex pattern to > search the User Agent after all. I got conflicting requirements. The > real idea is to detect a mobile device on a website and then show the > user an app download page. As Thomas has already hinted at, using the user agent string to detect the browser/device is unreliable. See <http://pointedears.de/scripts/faq/cljs/#detectBrowser>; the article doesn't deal with mobile devices, but the issues pointed out are basically the same. At least you should offer some way to get to the download page for all users. However, it seems to be preferable to look for a more reliable solution in the first place. I don't know if there exists such a solution, though. -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | Simon Lewis <simonlewis2001@gmail.com> |
|---|---|
| Date | 2014-05-16 15:14 +0200 |
| Message-ID | <87lhu150hg.fsf@development.richardriley.net> |
| In reply to | #24184 |
Christoph Michael Becker <cmbecker69@arcor.de> writes: > Sithu.D wrote: > >> On Thursday, May 15, 2014 7:20:53 PM UTC+2, Christoph Michael Becker >> wrote: >> >>> Thomas 'PointedEars' Lahn wrote: >>> >>>> In most cases the need to "detect the type of device and os" is >>>> only a need >>> >>>> perceived because of lack of experience, not an actual need. >>> >>> ACK (at least wrt. to browser side scripting). >> >> Thanks, Christoph. It turns out all that I need is a regex pattern to >> search the User Agent after all. I got conflicting requirements. The >> real idea is to detect a mobile device on a website and then show the >> user an app download page. > > As Thomas has already hinted at, using the user agent string to detect > the browser/device is unreliable. See > <http://pointedears.de/scripts/faq/cljs/#detectBrowser>; the article > doesn't deal with mobile devices, but the issues pointed out are > basically the same. At least you should offer some way to get to the > download page for all users. > > However, it seems to be preferable to look for a more reliable solution > in the first place. I don't know if there exists such a solution, > though. No. Use the user agent. Why? because thats what people use when they *want* the full content or alternate content for a different device.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-05-16 15:46 +0200 |
| Message-ID | <2325020.szrhtIhYvG@PointedEars.de> |
| In reply to | #24185 |
Simon Lewis wrote: > Christoph Michael Becker <cmbecker69@arcor.de> writes: >> As Thomas has already hinted at, using the user agent string to detect >> the browser/device is unreliable. See >> <http://pointedears.de/scripts/faq/cljs/#detectBrowser>; the article >> doesn't deal with mobile devices, but the issues pointed out are >> basically the same. At least you should offer some way to get to the >> download page for all users. >> >> However, it seems to be preferable to look for a more reliable solution >> in the first place. I don't know if there exists such a solution, >> though. > > No. Use the user agent. Why? because thats what people use when they > *want* the full content or alternate content for a different device. You have learned from the wrong people again. You know, the same people that said augmenting host objects would be OK. -- PointedEars FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix> Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2014-05-16 09:49 +0100 |
| Message-ID | <o8kbn95kiq70r8lp65igauflra2an154vg@4ax.com> |
| In reply to | #24172 |
On Thu, 15 May 2014 18:40:24 +0200, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: >Denis McMahon wrote: > >> On Thu, 15 May 2014 02:32:25 -0700, Sithu.D wrote: >>> I need to find a way to detect the type of device and os calling an API >>> using JavaScript. I preferable need to do this in some way more reliable >>> than detecting the User Agent. Any ideas please? >> >> Is this javascript operating inside a web browser, or is it a script > >There is no javascript. <http://PointedEars.de/es-matrix> <snip> javascript : A convenient name for the group of programming languages that use most of the syntax and semantics described in ECMA 262. John
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web