I am calling ajax function which return some data in JSON format from wcf rest service. I am getting data when I user IE browser but it's failed to get data when I use Mozilla and Chrome browser.
Following is the code I am using.
<script src="js/JSon.js" type="text/javascript"></script>
<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="js/jquery.js" type="text/javascript"></script>
function fillcategory() {
var GetCategoryURl = "http://localhost:4444/Service1.svc/GetCategory"
var drp = "";
$.ajax({
cache: false,
type: "GET",
async: false,
url: GetCategoryURl,
dataType: "json",
success: function (objCategory) {
Category = objCategory;
}
,
error: function (xhr) {
}
});
fillSubcategory();
}
Rquest Header is:
OPTIONS /Service1.svc/GetCategory?_=1350649411289 HTTP/1.1
Host: localhost:4444
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Origin: http://localhost:14853
Access-Control-Request-Method: GET
Access-Control-Request-Headers: x-requested-with
Response Header is:
HTTP/1.1 405 Method Not Allowed
Allow: GET
Content-Length: 1565
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Fri, 19 Oct 2012 12:23:56 GMT