A. Yes, but not without sending another HTTP request.
B. Yes, because PHP executes before JavaScript.
C. No, because JavaScript is server-side, and PHP is client-side.
D. No, because JavaScript executes before PHP.
Answer A is correct.
Although your instincts might lead you to believe that you
cannot pass data from JavaScript to PHP, such a thing can be achieved with another
HTTP request. Answer B is incorrect because PHP executing before JavaScript
is not what makes this possible.This is actually the characteristic that might lead you to believe (incorrectly) that the answer is no. Answers C and D are incorrect because the answer is yes, but also because the explanations given are false
Post new comment