IE, Firefox, Opera not calling complete function in ajax call

Using CoffeeScript in a Rails 3 app I have a simple ajax call:

$(document).ready ->

fetchProfile = (profile_id) ->

    fetchingProfile = null

    if fetchingProfile
        fetchingProfile.abort()

    fetchingProfile = $.ajax
        type: "GET"
        dataType: "json"
        url: "/api/profiles/" + profile_id
        cache: false
        timeout: 8000

        beforeSend: ->
            $("#loading-div").show()

        complete: ->
            $("#loading-div").hide()
            $("#info-box").show()

        success: (result) ->
            $("span#name").text(result.name)
            $("span#position").text(result.position)
            $("span#number").text("#" + result.number)
            $("span#experience").text(result.experience)
            $("span#nationality").text(result.nationality)
            $("span#height").text(result.height_feet + "' " + result.height_inches + "\"")
            $("span#age").text(result.age)
            $("span#weight").text(result.weight + "lbs")
            $("span#favteam").text(result.favourite_nfl_team)
            $("#photo-wrapper > img}").attr("src", result.photo.player.url)

        error: (result) ->
            if (result.statusText != "abort")
                $("#error").show()


$("a#fancybox-link").click ->
    $("a.profile-link").removeClass("selected")
    $(@).addClass("selected")
    fetchProfile($(@).data("profile"))

$("a#error-link").click (e) ->
    e.preventDefault
    fetchProfile($("a.selected").data("profile"), $("a.selected").data("user"))

This call works fine in Chrome and Safari but not the above browsers.

I tried putting an alert in the complete function and the function is just not getting called at all in FF, IE or Opera.

Any ideas??

Answers


Revisited this after a couple of months as it wasn't high priority.

Turns out it was a simple typo. Doh!

It was the } in this line $("#photo-wrapper > img}").attr("src", result.photo.player.url)

I guess chrome is a bit more forgiving than firefox.


Need Your Help

Jersey client SSL mutual authentication

java ssl jersey-client

I am building an app where I am using Jersey client to query some information from another server. I am executing the call in the following manner:

Can I access an encrypted SQL Server Compact database in Excel VBA?

sql excel excel-vba connection-string compact-database vba

I want to access an encrypted SQL Server Compact Edition database via VBA. I can access the database fine when it is not encrypted, but the code breaks when I try to use a password: