my app has a submit feedback form. Is there a way to can capture the user’s browser & version with jQuery and post that along with the form?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This information is contained in the HTTP_USER_AGENT header and you can retrieve it on the server without having to try to figure it out on the client and then post it as part of your form data. Obviously the mechanism to extract this information depends on your server-side engine. This is the ASP.NET version but there will be an equivalent way to retrieve the header info in whatever server you’re using. @mVChr’s answer is useful when you are trying to determine the user agent on the client side if there is some browser-specific behaviour you are trying to implement.
If you post the info back in hidden form fields you are effectively duplicating information that is already in the request.