jQuery ajax request response is empty in Internet Explorer

Posted by Aprilia1982 on Stack Overflow See other posts from Stack Overflow or by Aprilia1982
Published on 2011-01-04T15:08:35Z Indexed on 2011/01/04 16:53 UTC
Read the original article Hit count: 153

Filed under:
|
|

Hi,

I'm doing the following ajax call:

//exif loader
function LoadExif(cImage) {
    $.ajax({
        type: "POST",
        url: "http://localhost:62414/Default1.aspx/GetImageExif",
        data: "{iCurrentImage:" + cImage + "}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        error: ajaxFailed,
        success: function (data, status) {
            var sStr = '';
            for (var count in data.d) {
                sStr = sStr + data.d[count];
            };
            alert(sStr);              
        }
    });
};

In Firefox the request works really fine. When I try to run the code in Internet Explorer, the response is empty.

Here is the webmethod witch is called:

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
Public Shared Function GetImageExif(ByVal iCurrentImage As Integer) As String
    Dim sbTable As New StringBuilder
    sbTable.AppendLine("<table>")
    sbTable.AppendLine("<tr>")
    sbTable.AppendLine("<td>Name</td><td>" & gGallery.Images(iCurrentImage).File.Name & "</td>")
    sbTable.AppendLine("</tr>")
    sbTable.AppendLine("</table>")
    Return sbTable.ToString
End Function

Any ideas?

Jan

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery