Javatpoint Logo
Javatpoint Logo

<apex: includeScript> in Visualforce Page

The <apex: includeScript> is another important component in the Visualforce page that links to a JavaScript library. When we specify this component, a script reference into the generated HTML page's head element is injected by the <apex: includeScript>.

We can make this component safe inside an iteration component by de-duplicated multiple references to the same script.

The HTML pass-through attributes are supported by this component using the "html-" prefix, which is attached to the generated <script> tag.

The <apex: includeScript> has the following attributes on the Visualforce page:

1. d

The id is a string-type attribute, i.e., a unique identifier that allows other components in the page to reference the component.

Syntax:

2. loadOnReady

The loadOnReady is a boolean-type attribute used for specifying whether the script resource is loaded immediately or not. If not, the resource will be loaded after the document model is designed. The boolean value false is set as the default value for this attribute.

Syntax:

3. value

The value is an object-type attribute used to specify the URL to the JavaScript file. We can specify a reference to a static resource or a plain URL.

Syntax:

Let's take an example to understand how we can use this component on the Visualforce page:

ApexIncludeScriptExample.vfp

Output

<apex: includeScript> in Visualforce Page





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA