Created
June 17, 2012 13:04
-
-
Save melvincarvalho/2944506 to your computer and use it in GitHub Desktop.
post sparql update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postFile = function(file, data) { | |
if (typeof XMLHttpRequest == "undefined") | |
XMLHttpRequest = function () { | |
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } | |
catch (e) {} | |
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } | |
catch (e) {} | |
try { return new ActiveXObject("Microsoft.XMLHTTP"); } | |
catch (e) {} | |
//Microsoft.XMLHTTP points to Msxml2.XMLHTTP and is redundant | |
throw new Error("This browser does not support XMLHttpRequest."); | |
}; | |
xhr = new XMLHttpRequest(); | |
xhr.open('POST', file, false); | |
xhr.setRequestHeader('Content-Type', 'application/sparql-query'); | |
xhr.send(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment