| << 2.1.2- Going Deeper into HTTP | Chapter2 | 2.2.1- Which Scripting Language to Use >> |
How Scripting Languages Work
So now we've got
a better understanding of how a browser sends a web page request, and how
the web server sends the page back to the browser. If you cast your mind back
to the 6-step process for delivering a web page, you'll recognize that these
correspond to Steps 2 and 5. Let's remind ourselves of those six steps again:
In between, as we saw in Chapter 1 , the web server needs to locate the page that was requested (Step 3); and, if it's an ASP page, then the web server will need to process the ASP, in order to generate the HTML that is returned to the browser (Step 4).
Well, we've studied many of the necessary aspects surrounding ASP, but our understanding of the ASP processing itself is still rather sketchy. Up to now, for simplification, we've discussed it rather as though the ASP script engine were like a sausage machine – the web server feeds in the raw ASP code 'meat' at one end, and out of the other end comes a neatly packaged product. It's time to demystify this process.
The first attempts to add depth to the capability provided by the HTML language involved creating a mixture of pure HTML code and programming commands. As we saw in Chapter 1 , it's this that allows us to write instructions about how the page is to be created – effectively, we can write code (in the form of the programming commands), that will describe how the HTML should be put together at the time the page is requested.
In order to distinguish these nuggets of programming capability embedded within our HTML, we refer to them as scripts. However, HTML isn't a programming language, and so it's necessary to write these commands in other languages. We use the term scripting language to describe the languages in which these scripts are written.
HTML allows us to include scripts at (almost) any point in our HTML code – it does this by providing us with legal ways of inserting scripts, which we'll come to shortly. Subsequently, when the page has been requested and its HTML is being generated, each script within the page is sent to a script host (an application that communicates with different scripting engines). The script host in turn instructs the appropriate script engine to interpret the script.
Scripting languages form the basis of ASP. We use scripts to write the instructions that allow pages to be created dynamically. We also use scripts to access the various bits and pieces that ASP provides; these bits and pieces are known as objects, and we will look at them shortly.
| << 2.1.2- Going Deeper into HTTP | Chapter2 | 2.2.1- Which Scripting Language to Use >> |

RSS
