Marco Dinatsoli
Marco Dinatsoli

Reputation: 10580

Uncaught TypeError: Cannot read property 'ownerDocument' of null on jquery

This is my code

$.ajax({
       url: "http://localhost:42046/WebService1.asmx/HelloWorld",
       type: 'get',
       success: function (data) {
       $("#fillme").html(data);
      }
});

when I remove the $("#fillme").html(data); the error goes.

html

<span id="fillme"></span>

Upvotes: 2

Views: 18994

Answers (1)

Kiril
Kiril

Reputation: 2963

Seems that the problem is in parsing the xml from the web-service. You'll see it if just execute http://localhost:42046/WebService1.asmx/HelloWorld in browser. I would recommend to review your web-service and make it to return data in a correct format (I'm not sure what exactly do you need but it seems like string). Also try to change $.ajax parameters (api.jquery.com/jQuery.ajax), pay attention to contents, converters.

Upvotes: 3

Related Questions