在浏览器中显示服务错误,但在chrome和ie中工作,但在firefox中不工作

Showing service error in browsers but working in chrome and ie but not in firefox

本文关键字:工作 但在 ie 浏览器 firefox chrome 错误 显示 服务      更新时间:2023-09-26

我有服务方法,当调用到达它,它显示错误在所有浏览器internet explorer 8,chrome和firefox 8.0.1。

error is

OPTIONS http://abc/AddRating 405 (Method Not Allowed)

但是我的服务方法在chrome和ie8中执行,而不是在firefox mozila中执行。这是firebug网络响应

Response Headers    view source
Allow   POST
Content-Length  1565
Content-Type    text/html; charset=UTF-8
Server  Microsoft-IIS/7.5
X-Powered-By    ASP.NET
Access-Control-Allow-Orig...    *
Access-Control-Allow-Meth...    POST, GET
Access-Control-Allow-Head...    Origin, Content-Type, Accept
Date    Wed, 23 Nov 2011 06:34:56 GMT

Request Headersview source
Host    services.farooq.tv
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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
Connection  keep-alive
Origin  http://localhost:7844
Access-Control-Request-Me...    POST
Access-Control-Request-He...    content-type
Pragma  no-cache
Cache-Control   no-cache

这就是我的函数代码的样子。

function addService(comments) {
    try {
        // User details
        var user = { "Id": 2007, "FirstName": "Ufone", "LastName": "", "EmailAddress": "ahmed.ali@vidizmo.com509" };
        var ratingInfo = {
            "Id": 0,
            "TenantId": _settings.tenantId,
            "UserId": user.Id,
            "FirstName": user.FirstName,
            "LastName": user.LastName,
            "Rating": 0,
            "EmailAddress": user.EmailAddress,
            "Comments": comments,
            "RatedObjectTypeInfo": { "Id": 2 },
            "RatingTypeInfo": { "Id": 1 },
            "MashupRatingInfo": { "MashupMetaInfoId": _settings.ratedObjectId },
            "RatedObjectId": _settings.ratedObjectId,
            "TotalCount": 0
        };
        // AddRating service Url.
        var url = "http://abc/AddRating";
        $.ajax({
            type: "POST",
            url: url,
            data: JSON.stringify(ratingInfo),
            contentType: "application/json",
            timeout: 5000,
            crossDomain: true,

            success: function (success) {
                if (success == true) {
                    $("#addCommentsTable").hide();
                    var sMsg = document.getElementById('successMsg');
                    sMsg.style.display = "block";
                    // Setting value of a global variable _settings.start to 0 inorder to call the service right from page 1.
                    _settings.start = 0;
                    // Calling Comment displaying Service.
                    service(_settings);
                }
            },
            error: function (xhr, ajaxOptions, thrownError) {
                alert(xhr);
            }
        });
    }
    catch (err) {
        alert(err);
    }
}

请任何人都可以帮助?????

为了处理这个问题,我现在使用处理程序,我的应用程序在所有浏览器和设备上运行良好。

相关文章: