JavaScript Reference/Javascript Properties/userAgent

Материал из Web эксперт
Перейти к: навигация, поиск

"userAgent" Example

   <source lang="javascript">
   

<html> <body> <button onclick="alert(navigator.userAgent);">User Agent</button> </body> </html>


     </source>
   
  


"userAgent" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |clientInformation navigator | +----------------+--------------------------------------------------------------+

     </source>
   
  


"userAgent" Syntax and Note

   <source lang="javascript">

Note: Read-only property. Returns the name and version of the user agent, or browser.

Syntax:

objectName.userAgent


     </source>