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
  • 102,619
  • 17
  • 182
  • 182
MZaragoza
  • 10,108
  • 9
  • 71
  • 116

0 Answers0