views:

84

answers:

1

Hello,

going to http://revyu.com/sparql?query=SELECT+%2A+WHERE+%7B%7D works totally fine by returning an XML file, but as soon as I use jQuery, I'm getting errors:

var sparql="SELECT * WHERE {}";
var query = 'http://revyu.com/sparql?query=' + escape(sparql);

$.ajax( {
        dataType: "xml",
         url : query,
         success : function(data) {
            alert(data);
        },
        error:function (xhr, ajaxOptions, thrownError){
                alert(xhr.status);
                alert(thrownError);
        } 
});

thrownError: TypeError: Cannot read property 'documentElement' of null.

Any idea why this is? Thanks a lot!

A: 

The problem may be the specified dataType. See the relevant jquery doc here. Try changing the dataType to "text".

Tahbaza