在我的网站上,我引用了一个 javascript 文件,而在 IE 上,抛出了这个错误:
send: function (data) {
/// <summary>Sends data over the connection</summary>
/// <param name="data" type="String">The data to send over the connection</param>
/// <returns type="signalR" />
var connection = this;
if (!connection.transport) {
// Connection hasn't been started yet
throw "SignalR: Connection must be started before data can be sent. Call .start() before .send()";
}
connection.transport.send(connection, data);
return connection;
},
这throw
被 Internet Explorer 捕获,它似乎阻止了任何其他 javascript 的运行。
我该怎么做才能使错误不会完全停止我页面上的所有内容?