IBundlerBundleHtml Method |
Replaces multiple statements in the HTML that drag in JavaScript files with a single statement that
downloads all of the files in one go.
Namespace: VirtualRadar.Interface.WebSiteAssembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax string BundleHtml(
string requestPathAndFile,
string htmlContent
)
Function BundleHtml (
requestPathAndFile As String,
htmlContent As String
) As String
String^ BundleHtml(
String^ requestPathAndFile,
String^ htmlContent
)
abstract BundleHtml :
requestPathAndFile : string *
htmlContent : string -> string
Parameters
- requestPathAndFile
- Type: SystemString
The path and file part of the request URL for the HTML file being served. - htmlContent
- Type: SystemString
The original content of the HTML file.
Return Value
Type:
StringThe (possibly modified) content of the HTML file.
Remarks
Bundles are delineated in the HTML with two HTML comments. The opening comment, which comes before the first of
a set of files to bundle together, is of the form:
!<-- [[ JS BUNDLE START ]] -->
The end tag is:
!<-- [[ BUNDLE END ]] -->
All script statements of type="text/javascript" between the BUNDLE START / END lines are removed, unless
they point to remote files, and are replaced with a single statement. The URL for the single statement has a random
unique filename. When the browser requests that file the bundler causes the site to serve a file that has the content
of all of the JS files concatenated together into a single file.
The JavaScript files that are concatenated together are fetched via the web site.
See Also