D
D
Dmitry Filandor2016-12-01 18:08:04
JavaScript
Dmitry Filandor, 2016-12-01 18:08:04

How to debug ajax error?

Hello! There is such a url city-afisha.com/Events/Event/2848

script on this page:

var t = '';
    function gText(e) {
        t = (document.all) ? document.selection.createRange().text : document.getSelection().toString();




        if (t.length > 30) {
            $.ajax({
                url: '@Url.Action("LgVr", "Utils")',
                type: 'POST',
                cache: false,
                traditional: true,
                data: {
                    id: '@Model.Event_Id',
                    title: '@Model.Title'
                }
            });
        } //  if (t.length >

    }

    document.onmouseup = gText;
    if (!document.all) document.captureEvents(Event.MOUSEUP);


that is, when copying, or rather, selecting, there is a post request with some info. I don't understand how to debug this error...? it doesn't reach the controller if you set a breakpoint in the studio... you have to look for the error longer, by typing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nemiro, 2016-12-01
@LifeAct

Turn off error handling (in web.config and filters) and see what the problem is.
The scientific poke method says that the problem is in the encoded data (highlighted in bold):

%26%23171%3B => «
%26%23187%3B => »

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question