1

I am using the code below to find the User Agent using ActionScript 3:

var userAgent:String = ExternalInterface.call("navigator.userAgent.toString");

The code is working in Firefox 13, Google Chrome & Opera, but the User Agent value as null in IE8.

Is there any code snippet that will work here or any other way to implement this?

4

1 回答 1

0

toString是不必要的,因为 userAgent 是一个字符串属性。请改用此语法:

var userAgent:String = ExternalInterface.call("function(){return navigator.userAgent}")
于 2012-07-24T20:49:14.723 回答