Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8516699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:30:11+00:00 2026-06-11T05:30:11+00:00

Using CoffeeScript in a Rails 3 app I have a simple ajax call: $(document).ready

  • 0

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??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:30:13+00:00Added an answer on June 11, 2026 at 5:30 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started using coffeescript with Rails and I am finding that sometimes
I am working on rails 3.2 and using coffeescript too.. I have a doubt
I'm using CoffeeScript and jQuery, trying to get the data from an ajax call
I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript
The server is running off Ruby on Rails. Javascript is written using Coffeescript. I
I'm using Rails 3.1 and trying to add some ajax functionality (using jquery +
I'm using CoffeeScript in a Rails application, and I would like to unit test
Using Rails 3.2.0 with haml, sass and coffeescript: Basically I am trying to disable
I am working on a Rails 3.1 app and am happily using SASS and
I'm using Jasmine with CoffeeScript (in Rails 3.1) and test_track . Everything else is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.