HTML and CSS Reference
The page has no dependencies and is self-contained.
As a developer, you don't have to look in several
places to find out things specific to a page.
The page is larger and takes more time to download.
The script code cannot be used outside the page that
Restructuring the code to minimize duplicated func-
tionalities is compromised by the fact that no code
reuse is possible outside the page.
Script code cannot be cached by browsers separately
from the page.
In addition, there's another point to consider: with embedded code, any changes to the script are
immediately visible. You just save the file and refresh the browser. But when the script file is linked as
an external resource (more on this in a moment), then you need to play some tricks to ensure that
changes are immediately visible and not hidden by cached copies of the same file.
This aspect is certainly important, but it doesn't affect released applications. It is an important
aspect, but only during the development phase.
As an alternative to embedding code in a script element, you can use the same script element to link a
ded script. This is the way to go; or, at least, using externally linked files should always be the first
option you consider in general web development and in Windows 8 development.
jQuery and Windows 8
You can download the library from http://jquery.com .
Typical web developers use the jQuery library to unobtrusively bind handlers to events and to
detect page-level events, such as the event that indicates the page is ready for display. In addition,
web developers use jQuery to query for ad hoc subsets of page elements. With reference to the
previous chapter on CSS, you could say that jQuery offers a syntax that mimics the syntax of CSS
selectors. In reality though, jQuery selector syntax is even richer than CSS standards.
For developers who have a strong web background, the thought of writing HTML pages with-