A script fragment contains a script object. A script object contains reusable JavaScript functions or values that are stored separately from any particular form object, such as a date parser or a web service invocation. Typically, you use the script objects to create custom functions and methods that you want to use in many locations on a form. Using script objects reduces the overall amount of scripting required to perform repetitive actions.
Script fragments include only script objects that appear as children of variables in the Hierarchy palette. Fragments cannot contain scripts that are associated with other form objects, such as event scripts like validate, calculate, or initialize.
See also 

About script fragments