Javatpoint Logo
Javatpoint Logo

<apex: includeScript> Component 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. id

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


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.


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.


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



apex: includeScript Component in Visualforce Page

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA