P
P
Pu4u2015-04-10 07:21:38
PHP
Pu4u, 2015-04-10 07:21:38

How to get JavaScript results in php?

Using php I send data to the form of someone else's site. It checks the data with javascript and gives errors. How can I get these errors?
If you need to use a framework, tell me exactly how (I have not worked with frameworks before). Thanks everyone for the good replies.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Petrov, 2015-04-10
@Petroveg

XMLHttpRequest . In jQuery ajax() . There are similar ones in other libraries.

X
xtalen, 2015-04-10
@xom9lk

You will have to somehow emulate the work of the JavaScript engine. No other way.
Javascript is not being executed on someone else's site. It runs on the client.

M
matperez, 2015-04-10
@matperez

You can call PhantomJS via the command line and parse the response, or use some php.net/manual/ru/book.v8js.php. But these are all crutches.
If you are writing a parser, think about where the remote server script itself gets the data to generate content from. He generates them on his own or requests them from somewhere in the backend. If the latter, it would be more correct to intercept the original data (before display) and not bother with JS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question