2012-04-02 7 views
0

ich Browser-Anfragen in Client-Seite bekommen möchte ich schrieb diesen Code dafür:get Browser-Anfragen in client

<script type="text/javascript"> 
    var req = null; try { req = new XMLHttpRequest(); } catch (e) 
{ } if (!req) try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) 
{ } if (!req) try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } 
req.open('TRACE', 'http://localhost/Xmlobject.aspx', false); 
req.send(); alert(req.responseText); </script> 

aber es hat folgenden Fehler:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://localhost:7474/xss1/Xmlobject.aspx :: <TOP_LEVEL> :: line 7" data: no] 

ich, dass in google gesucht und Ich fand Leute sagen, dass Sie nicht in Ihrer Domäne sind, aber ich bin in localhost. gibt es eine Möglichkeit, Browserantworten zu erhalten?

Antwort

0

Von the XHR documentation:

Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK.

Sie können nicht HTTP TRACE Anfragen mit XHR machen.