0

I have a function in JS. When I run it on the console I get the expected results

function hello(data) {
    $.foo = data;
}

$.ajax({
    type: "GET",
    url: "http://somesite.com/api?callback=hello&AssetId=123&returnFormat=json",
    dataType: "jsonp"
});

now when I convert it to coffee

hello = (data) ->
  $.foo = data
  return

$.ajax
  type: 'GET'
  url: 'http://somesite.com/api?callback=hello&AssetId=123&returnFormat=json'
  dataType: 'jsonp'

nothing happens

can someone tell me what I am doing wrong here

Jordan Running
  • 97,653
  • 15
  • 175
  • 173
MZaragoza
  • 9,803
  • 9
  • 62
  • 105

0 Answers0