tags:

views:

7

answers:

0

Ok I am working on a Script that will Sniff the Firefox Browser from all other using Feature Detection and i came up with the Following Code

<script type="text/javascript">
    <!--
    var CheckSet =
    {
           'Propeties': [
            {Property: 'azimuth', 'Result': 0},
            {Property: 'pitch', 'Result': 0},
            {Property: 'speakHeader', 'Result': 0},
            {Property: 'speakNumeral', 'Result': 0},
        ],
    };

    function CheckProperty(object, featureSet)
    {
        var loop;
        var features = CheckSet[featureSet];
        var level = 0;

        if (!features)
            return level;

        for (loop = 0; loop < features.length; loop++)
            if (typeof(object[features[loop].Property]) != 'undefined')
            {
                features[loop].Result = 1;
                ++level;
            }

        for (loop = 0; loop < features.length; loop++)
          {
            if (features[loop].Result == 1)
                  document.write('' + features[loop].Property + '-----' + features[loop].Result + '<br>');
            else
                document.write('' + features[loop].Property + '------' + features[loop].Result + '<br>');
          }
    }

    CheckProperty(document.body.style,'Propeties');

    //-->
    </script> ​

using the DOM Css2 Properties i differentiate Firefox with other browser so till now it give the output:

for firefox it gives like: azimuth------1 pitch------1 speakHeader------1 speakNumeral------1

and for other like safari chrome and other :

azimuth------0 pitch------0 speakHeader------0 speakNumeral------0

Now my Task is that i want to convert it to Serverside what i mean is that there will be a file on Server Side that will hold the JSON List that is:

var CheckSet =
        {
               'Propeties': [
                {Property: 'azimuth', 'Result': 0},
                {Property: 'pitch', 'Result': 0},
                {Property: 'speakHeader', 'Result': 0},
                {Property: 'speakNumeral', 'Result': 0},
            ],
        };

So that it is Secure from outside to change it to something else but how to do it i am still unaware i mean how will i connect the Script Function and the List of JSON and how will i call it from server to perform the Function of CheckProperty() on the client side...any idea? and Help??