User Agent is not accessible in Internet Explorer 8 using ActionScript 3

不羁岁月 提交于 2019-12-13 19:14:28

问题


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:


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

var userAgent:String = ExternalInterface.call("function(){return navigator.userAgent}")


来源:https://stackoverflow.com/questions/11310227/user-agent-is-not-accessible-in-internet-explorer-8-using-actionscript-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!