User Agent is not accessible in Internet Explorer

2019-08-03 04:07发布

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?

1条回答
再贱就再见
2楼-- · 2019-08-03 04:39

toString is unnecessary, since userAgent is a string property. Use this syntax instead:

var userAgent:String = ExternalInterface.call("function(){return navigator.userAgent}")
查看更多
登录 后发表回答