是否可以检测某些浏览器是否支持某些事件?我可以检测浏览器是否支持document.addEventListener,但我需要知道它是否支持DOMAttrModified事件.Firefox和Opera支持它,但Chrome和其他人不支持.
谢谢,如果有人可以帮助!
javascript browser-detection event-handling javascript-events detection
// Base class
var Base = function() {
this._value = 'base';
};
Base.prototype = {
constructor: Base,
// By function
getValue: function() {
return this._value;
},
// By getter
get value() {
return this._value;
}
};
// Sub class extends Base
var Sub = function() {
this._value = 'sub';
};
Sub.prototype = {
constructor: Sub
};
// Pass over methods
Sub.prototype.getValue = Base.prototype.getValue;
Sub.prototype.value = Base.prototype.value;
// ---
var mySub = new Sub();
alert(mySub.getValue()); // Returns 'sub'
alert(mySub.value); // Returns …
Run Code Online (Sandbox Code Playgroud) 请原谅我可怕的双关语.
基本上,交易是,主人是一个婊子.一个简单的fsockopen
脚本,无论是什么端口,服务器或任何东西,都将连接.试图从webhost获取服务器帮助(由于不幸的情况,我无法更改主机)被证明是无效的...一堆蠢货.phpinfo()
然而,一个简单的节目allow_url_fopen
正在开启并Registered Stream Socket Transports
允许我tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
.
那么,我错过了什么?听起来主机是否谨慎地阻止套接字连接?我的意思是,即使端口80不起作用:
Warning: fsockopen() [function.fsockopen]: unable to connect to www.google.com:80 (Connection timed out)