Script fragment (Definition)

A small portion of a script source text.

A script fragment is so small that it hardly qualifies as a script in its own right.

You might find a fragment of script in a <SCRIPT> block that is placed into am <HTML> document and executed inline as the page is loaded. It might contain only a single document.write() statement.

Another likely candidate for being called a script fragment is an event handler in an anchor tag. This might call a function or just set a variable value. It might be one or even several lines of JavaScript code separated by semi-colons.

See also:Script Source Text, Statement

Cross-references:

Wrox Instant JavaScript - page - 16