I need Backend help [Solved]

I need Backend help [Solved]
0

#1

I am stuck trying to figure out how to implement Yelp’s api with node. I’ve tried everything from using node-yelp to my own ajax. I can’t figure out what I’m missing. Here’s my current ajax code:

$.ajax({
‘type’: message.method,
‘url’ : message.action,
‘data’ : parameterMap,
‘dataType’ : ‘jsonp’,
‘jsonpCallback’ : ‘cb’,
‘cache’: true
})
.done(function(data, textStatus, jqXHR) {
console.log(‘braaaaiinnns!’);
console.log(‘success[’ + data + ‘]’);
}
)
.fail(function(jqXHR, errorThrown) {
console.log(‘error[’ + errorThrown + ‘], jqXHR[’ + JSON.stringify(jqXHR) + ‘]’);
}
);

I’d appreciate any feedback. Thanks.


#2
  1. What’s the error or problem?
  2. What’s the backend code doing?

#3

Thanks for replying. Nothing happens. I have the ajax function inside of a click function. After the click, I can console.log everything up to the ajax function but nothing inside of it.


#4

Never mind… I figured it out. It’s amazing how blind I can be after staring at code for a couple of hours. I was trying to require a file and I forgot a ‘.’