Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Browser Based

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 ...

  1. #1
    ashlee is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    108

    Smile Browser Based

    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.


  2. #2
    rachelle is offline Member Array
    Join Date
    Apr 2006
    Answers
    97
    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);
    .........................
    ................................


Latest Article

Network Security Risk Assessment and Measurement

Read More...