In general, such a thing, I load the label on ajax, the data in the usual html, stupidly pick it up and add it to the end of the necessary block. Depending on the transmitted GET parameters, I generate the necessary data. But here's the problem: loading is not what you need! Those. the data generated on the page does not coincide with the fact that ajax picks up! I checked it quite simply: I go to the page from where I load the Ajax and compare it.
Below is an example script:

$.ajax({ type: "GET", url: "/load_videos/", data: tst, dataType: "html", cache: false, success: function(data){ $("#table-div").append(data); } }); 

Where "tst" is the passed parameters (the usual string of a GET request).
In the usual handler hangs, I think it makes no sense to show it. Where to dig, that where might be wrong? It is interesting that when an empty GET request is received, there are no problems, it loads correctly.

    3 answers 3

    Error found ... Wrongly passed the 'data' parameter to the ajax () function.
    Transmitted in the form of

     '?key1=value1&key2=value2' 

    and it was necessary without the "?" as

     'key1=value1&key2=value2' 

    It would seem such a trifle ... A strange difference, for some reason I thought that the line should be like with a regular GET request :)

    • @ HashCode Accept my answer to the question. - metazet 2:24 pm

    Can try POST method?

    • I now use GET to catch such errors when I get the POST method - I’m not really going to trace anything ... But I’ll consider your proposal "magical" and postpone it for the most extreme case;) - metazet

    Can you give an example of the variable tst? It must have an object that contains a key / value set.

    • It can contain either a key / value object or a string. I am above (in the right answer) showed what and where. I have these lines skip: 'sort = popular & page = 2' and their ilk. - metazet