Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Is Limesurvey able to detect the used device?

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 2 months ago - 2 years 2 months ago #225133 by tammo
See attached the question (wrapped in an English survey), made up using the ideas of Joffm and before him Christian Ludwig (as shown in the Javascript),
 


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 2 years 2 months ago by tammo.
The following user(s) said Thank You: Surveylab_KN

Please Log in to join the conversation.

More
1 year 5 months ago #233855 by Masalas
Replied by Masalas on topic Is Limesurvey able to detect the used device?
Can anyone please check whether this is still working for him/her? For me, it simply displays (as question text) the qid followed by the commands that should paste the gathered info. Tried the original long text as well as @tammo |s version (where I imported the whole survey, then exported the single question, replaced all the en-language codes to my survey language in the lsq file and imported into my survey).

Looks like this:
 

Please Log in to join the conversation.

More
1 year 5 months ago #233856 by jelo

Can anyone please check whether this is still working for him/her?
 
Please provide a LSS export. Not sure anyone will retype your JS from an image to check it.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #233860 by tpartner
Replied by tpartner on topic Is Limesurvey able to detect the used device?
It looks to me like the JavaScript isn't being parsed. Do you have permissions to use JS?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Masalas

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago - 1 year 5 months ago #233867 by Joffm
Yes, exactly this you get with XSS filter ON
 

Joffm

See some more remarks about this in your German thread about the Screen Out.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 5 months ago by Joffm.
The following user(s) said Thank You: Masalas

Please Log in to join the conversation.

More
1 year 5 months ago #233889 by Masalas
Replied by Masalas on topic Is Limesurvey able to detect the used device?
Thank you for the quick advice. It indeeds looks a lot like xss filter is set to ON (Joffm's hello world script from the other thread doesn't work, either, although script execution and popups are allowed in the browser). Chances that the superadmin will turn the filter off are very low, but I will ask him tomorrow anyway.

Do you know of any other way to detect at least the horizontal resolution?
I can get a (shortened?) user agent and OS from the browser detection question type, but that doesn't help me to reliably distinguish between tablet and smartphone (or does it? E.g., with firefox on my smartphone and my tablet, the question simply reports "Firefox (<version no.>) | Android (<version no.>)".
The standard themes all use the horizontal resolution in order to switch from one viewport to another? Can I somehow access that information? If not, I could probably still mess with the theme editor to display a message to users with resolutions below x.xxx horizontal px window size (but how?)?

Cheers.

PS. @jelo: In order to check whether the error was on my side (importing/exporting/adjusting/importing again), I meant to ask you all to try the original code. Hence no lss export.

Please Log in to join the conversation.

More
1 year 5 months ago - 1 year 5 months ago #233924 by Masalas
Replied by Masalas on topic Is Limesurvey able to detect the used device?
The superadmin now deactivated xss protection for testing purposes, but I still can't get it to work. I created a question type "multiple short texts", created 8 subquestions (named the first few after joffm's screenshot), switched to source code editor, pasted the code below, set condition to 0, switched on always hide. After saving the question, everything above
Code:
{QID}').hide();
is gone, and so is the trailing </script> line.

I tried activating/deactivating the // comment-command hiding the question, tried inserting or deleting or moving the duplicate }); -- all to no avail. I'm out of ideas.

Attached is an lsq (German installation).  

File Attachment:

File Name: limesurvey...7887.lsq
File Size:15 KB

Code:
<script type="text/javascript" charset="utf-8">
    /**
     * JavaScript Client Detection
     * (C) viazenetti GmbH (Christian Ludwig)
     */
    (function (window) {
        {
            var unknown = '-';
 
            // screen
            var screenSize = '';
            if (screen.width) {
                width = (screen.width) ? screen.width : '';
                height = (screen.height) ? screen.height : '';
                screenSize += '' + width + " x " + height;
            }
var vpw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var vph = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
            // browser
            var nVer = navigator.appVersion;
            var nAgt = navigator.userAgent;
            var browser = navigator.appName;
            var version = '' + parseFloat(navigator.appVersion);
            var majorVersion = parseInt(navigator.appVersion, 10);
            var nameOffset, verOffset, ix;
 
            // Opera
            if ((verOffset = nAgt.indexOf('Opera')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 6);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Opera Next
            if ((verOffset = nAgt.indexOf('OPR')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 4);
            }
            // MSIE
            else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(verOffset + 5);
            }
            // Chrome
            else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
                browser = 'Chrome';
                version = nAgt.substring(verOffset + 7);
            }
            // Safari
            else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
                browser = 'Safari';
                version = nAgt.substring(verOffset + 7);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Firefox
            else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
                browser = 'Firefox';
                version = nAgt.substring(verOffset + 8);
            }
            // MSIE 11+
            else if (nAgt.indexOf('Trident/') != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(nAgt.indexOf('rv:') + 3);
            }
            // Other browsers
            else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
                browser = nAgt.substring(nameOffset, verOffset);
                version = nAgt.substring(verOffset + 1);
                if (browser.toLowerCase() == browser.toUpperCase()) {
                    browser = navigator.appName;
                }
            }
            // trim the version string
            if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);
 
            majorVersion = parseInt('' + version, 10);
            if (isNaN(majorVersion)) {
                version = '' + parseFloat(navigator.appVersion);
                majorVersion = parseInt(navigator.appVersion, 10);
            }
 
            // mobile version
            var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
 
            // cookie
            var cookieEnabled = (navigator.cookieEnabled) ? true : false;
 
            if (typeof navigator.cookieEnabled == 'undefined' &amp;&amp; !cookieEnabled) {
                document.cookie = 'testcookie';
                cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false;
            }
 
            // system
            var os = unknown;
            var clientStrings = [
                { s:'Windows 10', r:/(Windows 10.0|Windows NT 10.0)/ },
                { s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/ },
                { s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/ },
                { s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/ },
                { s:'Windows Vista', r:/Windows NT 6.0/ },
                { s:'Windows Server 2003', r:/Windows NT 5.2/ },
                { s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/ },
                { s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/ },
                { s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/ },
                { s:'Windows 98', r:/(Windows 98|Win98)/ },
                { s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/ },
                { s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
                { s:'Windows CE', r:/Windows CE/ },
                { s:'Windows 3.11', r:/Win16/ },
                { s:'Android', r:/Android/ },
                { s:'Open BSD', r:/OpenBSD/ },
                { s:'Sun OS', r:/SunOS/ },
                { s:'Linux', r:/(Linux|X11)/ },
                { s:'iOS', r:/(iPhone|iPad|iPod)/ },
                { s:'Mac OS X', r:/Mac OS X/ },
                { s:'Mac OS', r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
                { s:'QNX', r:/QNX/ },
                { s:'UNIX', r:/UNIX/ },
                { s:'BeOS', r:/BeOS/ },
                { s:'OS/2', r:/OS\/2/ },
                { s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
            ];
            for (var id in clientStrings) {
                var cs = clientStrings[id];
                if (cs.r.test(nAgt)) {
                    os = cs.s;
                    break;
                }
            }
 
            var osVersion = unknown;
 
            if (/Windows/.test(os)) {
                osVersion = /Windows (.*)/.exec(os)[1];
                os = 'Windows';
            }
 
            switch (os) {
                case 'Mac OS X':
                    osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
                    break;
 
                case 'Android':
                    osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1];
                    break;
 
                case 'iOS':
                    osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
                    osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
                    break;
            }
 
            // flash (you'll need to include swfobject)
            /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
            var flashVersion = 'no check';
            if (typeof swfobject != 'undefined') {
                var fv = swfobject.getFlashPlayerVersion();
                if (fv.major > 0) {
                    flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
                }
                else  {
                    flashVersion = unknown;
                }
            }
        }
 
        window.jscd = {
            screen: screenSize,
            browser: browser,
            browserVersion: version,
            browserMajorVersion: majorVersion,
            mobile: mobile,
            os: os,
            osVersion: osVersion,
            cookies: cookieEnabled,
            flashVersion: flashVersion,
            vieww : vpw,
            viewh: vph
        };
    }(this));
 
 
$(document).ready(function() {    
 
        // Hide this question (remove double slash below to hide)
        $('#question{QID}').hide();
 
var thisQuestion = $('#question{QID}');
// Fill the array
       $('input[type=text]:eq(0)', thisQuestion).val(jscd.os +' '+ jscd.osVersion);
       $('input[type=text]:eq(1)', thisQuestion).val(jscd.browser +' '+ jscd.browserMajorVersion +
          ' (' + jscd.browserVersion + ')' );
       $('input[type=text]:eq(2)', thisQuestion).val( jscd.vieww );
       $('input[type=text]:eq(3)', thisQuestion).val( jscd.viewh );
    });
    });
</script>
Last edit: 1 year 5 months ago by Masalas. Reason: added script code

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #233931 by holch
No LSQ or LSG, only LSS files. Help us to help you by making life easier for us.

switched on always hide


If you switch on "always hide" for the question via the GUI, Javascript can't access the question to write it. If you use Javascript, the questions involved (where the code is and where the script should write data to) need to be hidden via Javascript or CSS.

Because the GUI hides the question completely from the HTML code and thus Javascript can't use the question or can't run, because it was never rendered/there.

Anyway, hiding the questions is also something you do once everything is tested thoroughly.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #233932 by Joffm
Some first remarks:
1. And most important:
a. DO NOT HIDE the question by "Diese Frage immer verstecken".
b. DO NOT EXCLUDE it by a relevance equation "0"

Either use this line in the script
$('#question{QID}').hide();
Or hide the question with the css class "hidden"

2. At the end of the script there is a surplus });
    });
    });
</script>
Remove it.
Was ist a copy/paste mistake?
Thank god it is not in the sample file of the Tutorial.


Okay, this all does not solve your general javascript problem.
Does the small javascript test work?

As I get the same - your - result for an admin with XSS filter ON.
So double check this setting.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago #233937 by Masalas
Replied by Masalas on topic Is Limesurvey able to detect the used device?
So, the major issue seemed to be that "Disable question script for XSS restricted user" also had to be deactivated although the manual says otherwise (" If you disable XSS protection : then this settings are not used. " Not sure whether this is a bug in this particular version or still like this.

Anyway, the question still doesn't write anything to the answers table, despite condition==1 and "always hide" being off. Will upload an lss later tonight. Thank you and Thank you in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #233938 by Joffm

Anyway, the question still doesn't write anything to the answers table, despite condition==1 and "always hide" being off. Will upload an lss later tonight.

Of course, not.
At first you have to solve the script problem. As long as the script doesn't work, you will get not results.

My remarks were "on top". It wouldn't have worked, as@holch also mentioned with these settings as in this case the whole question is not available in the DOM.
But if the script is not removed by the filter you won't see the messy script in your question text.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago - 1 year 5 months ago #233944 by Masalas
Replied by Masalas on topic Is Limesurvey able to detect the used device?
Although I'm afraid I can't quite follow you, Joffm*, it now works correctly after logging out, back in again and pasting the script once more.
*All scripting for regular users had already been allowed in the superadmin panel at the time of my last post; the script had also already been correctly displayed in the question sourcecode window after saving the question; and the question had already been unhidden via GUI (German: "Diese Frage immer verstecken" ist aus und die "Bedingung" in den allgemeinen Einstellungen ist "1"). The duplicate }); had also been gone. It really seemed to be an issue of logging out and in again once more after the option "disable question script for xss restricted users" had been turned off.


For all who might read this in the future and are LimeSurvey/script beginners like I am, here are my takeaways:
  1. Allowing (disabling) "Filter HTML for XSS" in the global settings/Security is not enough. At least for LimeSurvey 5.2.7, superadmin needs to additionally allow (disable) "Disable question script for XSS restricted user" -- although the manual explicitly says otherwise.
  2. As is noted in the postings above, you have to activate sourcecode view in the question editor before pasting the code.
  3. As holch and Joffm noted, you must not hide the question via any other means than deleting // where it is written in the code (right before $('#question{QID}').hide(); ). And you most probably do want to hide the question.

    The following bulletin points are for users only who want to use the "multiple short text" question type:
  4. Where Joffm explains what to replace in order to use the script in a multiple short text question, he accidently did not include the last }); in the part that has to be deleted but then included this in the part that has to be added. In order for the script to work, it has to be there exactly once.
  5. Joffm in his code omitted several of the properties that the original script displays. Adding them back again is easy, though: just look a few lines above Joffm's code snippet where all properties are listed (screensize, browser, version, majorVersion, etc.) and add corresponding lines in Joffm's code. You can use my script below for added screen resolution, mobile status and full user agent (cookies status is not yet in there, and neither is flash, for obvious reasons).
  6. You need to create as many sub questions as you have properties. For my example below, it's 7 subquestions. It doesn't matter how you label them but it may be helpful to name them after what they assess. The script doesn't do that for you.

Cheers all.



Code:
<script type="text/javascript" charset="utf-8">
    /**
     * JavaScript Client Detection
     * (C) viazenetti GmbH (Christian Ludwig)
     */
    (function (window) {
        {
            var unknown = '-';
 
            // screen
            var screenSize = '';
            if (screen.width) {
                width = (screen.width) ? screen.width : '';
                height = (screen.height) ? screen.height : '';
                screenSize += '' + width + " x " + height;
            }
var vpw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var vph = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
            // browser
            var nVer = navigator.appVersion;
            var nAgt = navigator.userAgent;
            var browser = navigator.appName;
            var version = '' + parseFloat(navigator.appVersion);
            var majorVersion = parseInt(navigator.appVersion, 10);
            var nameOffset, verOffset, ix;
 
            // Opera
            if ((verOffset = nAgt.indexOf('Opera')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 6);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Opera Next
            if ((verOffset = nAgt.indexOf('OPR')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 4);
            }
            // MSIE
            else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(verOffset + 5);
            }
            // Chrome
            else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
                browser = 'Chrome';
                version = nAgt.substring(verOffset + 7);
            }
            // Safari
            else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
                browser = 'Safari';
                version = nAgt.substring(verOffset + 7);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Firefox
            else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
                browser = 'Firefox';
                version = nAgt.substring(verOffset + 8);
            }
            // MSIE 11+
            else if (nAgt.indexOf('Trident/') != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(nAgt.indexOf('rv:') + 3);
            }
            // Other browsers
            else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
                browser = nAgt.substring(nameOffset, verOffset);
                version = nAgt.substring(verOffset + 1);
                if (browser.toLowerCase() == browser.toUpperCase()) {
                    browser = navigator.appName;
                }
            }
            // trim the version string
            if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);
 
            majorVersion = parseInt('' + version, 10);
            if (isNaN(majorVersion)) {
                version = '' + parseFloat(navigator.appVersion);
                majorVersion = parseInt(navigator.appVersion, 10);
            }
 
            // mobile version
            var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
 
            // cookie
            var cookieEnabled = (navigator.cookieEnabled) ? true : false;
 
            if (typeof navigator.cookieEnabled == 'undefined' &amp;&amp; !cookieEnabled) {
                document.cookie = 'testcookie';
                cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false;
            }
 
            // system
            var os = unknown;
            var clientStrings = [
                { s:'Windows 10', r:/(Windows 10.0|Windows NT 10.0)/ },
                { s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/ },
                { s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/ },
                { s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/ },
                { s:'Windows Vista', r:/Windows NT 6.0/ },
                { s:'Windows Server 2003', r:/Windows NT 5.2/ },
                { s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/ },
                { s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/ },
                { s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/ },
                { s:'Windows 98', r:/(Windows 98|Win98)/ },
                { s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/ },
                { s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
                { s:'Windows CE', r:/Windows CE/ },
                { s:'Windows 3.11', r:/Win16/ },
                { s:'Android', r:/Android/ },
                { s:'Open BSD', r:/OpenBSD/ },
                { s:'Sun OS', r:/SunOS/ },
                { s:'Linux', r:/(Linux|X11)/ },
                { s:'iOS', r:/(iPhone|iPad|iPod)/ },
                { s:'Mac OS X', r:/Mac OS X/ },
                { s:'Mac OS', r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
                { s:'QNX', r:/QNX/ },
                { s:'UNIX', r:/UNIX/ },
                { s:'BeOS', r:/BeOS/ },
                { s:'OS/2', r:/OS\/2/ },
                { s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
            ];
            for (var id in clientStrings) {
                var cs = clientStrings[id];
                if (cs.r.test(nAgt)) {
                    os = cs.s;
                    break;
                }
            }
 
            var osVersion = unknown;
 
            if (/Windows/.test(os)) {
                osVersion = /Windows (.*)/.exec(os)[1];
                os = 'Windows';
            }
 
            switch (os) {
                case 'Mac OS X':
                    osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
                    break;
 
                case 'Android':
                    osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1];
                    break;
 
                case 'iOS':
                    osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
                    osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
                    break;
            }
 
            // flash (you'll need to include swfobject)
            /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
            var flashVersion = 'no check';
            if (typeof swfobject != 'undefined') {
                var fv = swfobject.getFlashPlayerVersion();
                if (fv.major > 0) {
                    flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
                }
                else  {
                    flashVersion = unknown;
                }
            }
        }
 
        window.jscd = {
            screen: screenSize,
            browser: browser,
            browserVersion: version,
            browserMajorVersion: majorVersion,
            mobile: mobile,
            os: os,
            osVersion: osVersion,
            cookies: cookieEnabled,
            flashVersion: flashVersion,
            vieww : vpw,
            viewh: vph
        };
    }(this));
 
 
$(document).ready(function() {    
 
        // Hide this question (remove double slash below to hide)
         $('#question{QID}').hide();
 
var thisQuestion = $('#question{QID}');
// Fill the array
       $('input[type=text]:eq(0)', thisQuestion).val(jscd.os +' '+ jscd.osVersion);
       $('input[type=text]:eq(1)', thisQuestion).val(jscd.browser +' '+ jscd.browserMajorVersion +
          ' (' + jscd.browserVersion + ')' );
       $('input[type=text]:eq(2)', thisQuestion).val( jscd.vieww );
       $('input[type=text]:eq(3)', thisQuestion).val( jscd.viewh );
       $('input[type=text]:eq(4)', thisQuestion).val( jscd.screen );
       $('input[type=text]:eq(5)', thisQuestion).val( jscd.mobile );
       $('input[type=text]:eq(6)', thisQuestion).val( navigator.userAgent );
    });
</script>
Last edit: 1 year 5 months ago by Masalas.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose