S
S
Sergey Titov2015-02-08 02:18:21
PHP
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)
5531ebe5e8984ba88050475ac520640b.png

And here is php itself, where, in theory, I send the request
6d1b1306c3d4fbaa77ea127aafd27f0a.png

Answer the question

In order to leave comments, you need to log in

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

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 :)

N
Nikita, 2015-02-08
@Panda_Tamara

and if you add dataType when calling ajax?

I
IceJOKER, 2015-02-08
@IceJOKER

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.

N
Nazar Mokrinsky, 2015-02-08
@nazarpc

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

L
lnked, 2015-02-08
@lnked

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

A
Artem Lipatov, 2015-02-08
@Rendalf

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

A
Alexey Yakhnenko, 2015-02-08
@ayahnenko

debug
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