I'd like to get a script that can grab the user's user agent and prop it to an attribute.
I'm making a website problems contact form and I usually need to know what browser the user is using. How can I detect the user agent string and prop it as the value of an input element.
My html looks something like:
I want the user agent to be added to that as the value attribute so it would look like:
You should not need any JavaScript to do this. Just read the user-agent-string from the HTTP header.
以上就是Getting the User Agent with JavaScript的详细内容,更多请关注web前端其它相关文章!