Sergey Titov2015-02-08 02:18:21
Sergey Titov, 2015-02-08 02:18:21

$.ajax asynchronous request failing?

An asynchronous request does not work, I have been suffering for 8 hours already, I watched a ton of video tutorials, I seem to be doing everything right.
There is an assumption that the url is not correctly specified, but I tried it this way and that :(
Here is the javascript itself, its location can be seen on the left (I highlighted it)

And here is php itself, where, in theory, I send the request

Answer the question

In order to leave comments, you need to log in

7 answer(s)
Sergey Titov, 2015-02-08

That's it, I figured it out, thanks to everyone, the error was that I connected to the class that connects to the main page, respectively, knocked out errors, there is no connection type to the database, etc., redirected to the main page where this class is connected and everything worked great :)

Nikita, 2015-02-08

and if you add dataType when calling ajax?

IceJOKER, 2015-02-08

Use the browser console - this is perhaps one of the best friends of a WEB developer, it simplifies life at times))
firebug for example or built-in.

Nazar Mokrinsky, 2015-02-08

How do you determine what doesn't work? Open the development tools, take a look at the network, and see what goes where.

lnked, 2015-02-08

Try prefixing engine/classes... with a slash /engine/classes...

Artem Lipatov, 2015-02-08

What if we add return false to the end of the button click handler?

Alexey Yakhnenko, 2015-02-08

in the browser console, see where the request goes, set a
breakpoint in index.php and see where the route goes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question