Stereotape
2012-05-11 07:16:18 UTC
My question is, in what order do these events actually happen? A specific, step-by-step explanation of the web page life cycle would be great.
I ask because I want to know if you can embed PHP into a piece of JavaScript. The way I understand the web page life cycle:
1. The server executes ALL of the PHP code in a file.
2. The file generated from this execution is then sent to the client.
3. The client runs all JavaScript code.
If this is how it works, PHP should be embedded into Javascript no problem, because PHP comes first. However, it doesn't seem to work, so I'm thinking I have the life cycle wrong.