A
A
Alexander2017-10-10 00:30:12
JavaScript
Alexander, 2017-10-10 00:30:12

How to deal with ajax + json?

Hi everyone... I've been freaking out about JSON and AJAX for 2 hours. I will say right away, I work with JS using instructions ...
The bottom line is, I call ajax on click and send a request - the request goes away, and silence in response ...
JS:

$.ajax({
                        url: '/module/goods/ajax/group_delete.php', 
                        data: {delID: getParams},
                        contentType: "application/json; charset=utf-8",
                        dataType : "jsonp",
                        success: function (data) {
                            console.log(data);
                        }
                    });

The page returns encoded JSON:
[{"id":"1","name":"\u0420\u043e\u043b\u043b \u0424\u0438\u043b\u043a\u0430","group_id":"1","unit":"\u0433\u0440.","price":"259","photo":"","sostav":"\u0427\u0442\u043e \u0442\u043e \u0441 \u0447\u0435\u043c\u0442\u043e","onVK":"1","showSite":"1","showOMS":"1","changePrice":"1","watermark":"1","addtime":"","addadmin":""}]

And that's all - silence in response ... No errors, just silence ... I ask for help from specialists (((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kuznetsov, 2017-10-10
@dima9595

1. You did not specify what type of request will be: get, post or another (I don’t know for sure if others can be used).
2.
It gives the answer:

[{"id":"1","name":"\u0420\u043e\u043b\u043b \u0424\u0438\u043b\u043a\u0430","group_id":"1","unit":"\u0433 \u0440.","price":"259","photo":"","sostav":"\u0427\u0442\u043e \u0442\u043e \u0441 \u0447\u0435\u043c\u0442\u043e"," onVK":"1","showSite":"1","showOMS":"1","changePrice":"1","watermark":"1","addtime":"","addadmin": ""}]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question