I am calling a .NET web service from a jQuery file which is not part of the project. Whenever I call the service it says OPTIONS /HOCWebService.asmx/HelloWorld and does not return anything. What is going on? In the web.config I have specified that the web service is allowed httpGet and httpPost.
UPDATE 1:
$.ajax(
{
type: "POST",
url: "http://127.0.0.1:8080/HOCWebService.asmx/HelloWorld",
data: "{}",
dataType: "json",
contentType: "application/json",
success: function (response) {
alert(response.d);
var categories = $.evalJSON(response.d);
for (i = 0; i < categories.length; i++) {
var span = $(document.createElement("span"));
$(span).addClass("ui-li-count");
$(span).html(categories[i].Count);
var li = $(document.createElement("li"));
var anchor = $(document.createElement("a"));
$(anchor).attr("href", "/Home/detail/"+categories[i].Id);
$(anchor).html(categories[i].Title);
$(li).append(anchor);
$(li).append(span);
// $("#categoriesListView").append('<li><a href="/Home/detail/' + categories[i].Id + '">' + categories[i].Title + '</a></li>');
$("#categoriesListView").append(li);
// $(span).text(categories[i].Count);
}
$("#categoriesListView").listview('refresh');
}
}
);