This is a discussion on Browser Based within the Java forums, part of the Programming Talk category; I am doing my application using JavaScript. But I want to code my JavaScript application based on the browser. Someone ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am doing my application using JavaScript. But I want to code my JavaScript application based on the browser. Someone tell me how can I code to detect browser so that I can code my JavaScript based on this.
|
|
|||
|
Have a variable first declared for getting the browser type. Now define various variables for each of the browser type checking and check whether it is equal to the index type of the variable defined for browser type detected. Among these variables whichever variable retunes a true value would take the path of execution of further code in your JavaScript.
A sample logic is given below: var test = navigator.test var a = (userAgent.indexOf('browser1') != -1); var b = (userAgent.indexOf('browser2') != -1); ......................... ................................ |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial on Silk Test | spriya279 | Testing Tutorials | 2 | 02-15-2007 07:31 PM |
| What is the best browser ? | insane | Chit-Chat | 24 | 06-05-2006 12:45 AM |
| Technical Support (Voice Based) or Non Technical Voice Based - Chennai | techguru | Freshers Jobs | 0 | 06-08-2005 07:07 AM |
| Apple II Csa2 FAQs: Uploading & Downloading, Part 21/25 | rubywand@swbell.net | Tech FAQ | 0 | 05-04-2004 10:01 AM |
| [FAQ] FileMaker Pro - database for Macintosh and Windows | Martin Trautmann | Tech FAQ | 0 | 04-17-2004 08:26 AM |