2011-09-19 5 views
0

실행을 중지 IE에서 페이지가 발생, 나는 자바 스크립트 파일에 대한 참조를 가지고 있고, 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이 인터넷에 의해 체포되고 있음 탐색기, 그리고 다른 자바 스크립트가 실행되는 것을 멈추는 것처럼 보입니다. 나는 그래서 오류가 완전히 내 페이지에 모든 것을 중단하지 않습니다 수행 할 수있는

enter image description here

?

+0

예외가 유효합니까? 사용하지 않도록 설정해야하는 것은 무엇입니까? – davidfowl

답변

1

예외를 발생시키지 않으려면 왜 던지기를 사용하고 있습니까? 로깅 목적으로 예외를 원한다면이 점을 고려하십시오.

if (!connection.transport) { 
    // Connection hasn't been started yet 
    setTimeout(function() { 
     throw "SignalR: Connection must be started before data can be sent. Call .start() before .send()"; 
    }, 0); 
    return; 
} 
+0

또는 console.error https://developer.mozilla.org/en-US/docs/Web/API/console.error –

관련 문제