I'm new to web development. I've google'd the question and found no result. To begin, consider the following code:

```
<p id="par">Hello World</p>

```

If you have PHP set-up, the following is valid:

```
<p id="par"><?php echo "Hello World";?></p>

```

Both produces the same result, but what I recall is that PHP codes are executed in the server, thus the following question arise concerning the execution of the code: 

Is `<p></p>` element first retrieved from server, while some background ajax process waits for the "Hello World"?

I'd really like to know so I can make a more predictable code. Another possible scenario that bothers me is when using javascript and/or jQuery:

```
$(document).load(function(){
   $("#foo").width($("#par").width());
});

```

which raises the question, does it wait for PHP server requests to finnish or does it just load the page therefore, some code that will need to react to the size of the `<p>` element above will be a bug?

Again, pardon the beginner question.