D
D
Danil2015-05-30 09:36:41
Node.js
Danil, 2015-05-30 09:36:41

How to fix ajax issue?

My router:

router.get('/getlist', function(req, res) {

    console.log('got a request!')
    res.send('somedata');
    res.end()

})

My request:
$.ajax({
            url: '/router/getlist', 
            success: completeHandler
        });
  function completeHandler(){
    console.log('sucsess')
  }

The node console.log()does not work in the console, but the client outputs sucsess
It turns out that the router does not process the request. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kotofey, 2015-05-30
@kotofey

$.ajax({
  url: '/getlist', 
  ...
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question