Target

<< Click to Display Table of Contents >>

Navigation:  IWCL > IntraWeb Library Loader > Parameters >

Target

Type: String (ID of an HTML element)

 

Description:

The Target parameter defines where to render the IWML content. By default, it replaces the entire <body> element with the loaded IWML.

 

To integrate IWML into an existing HTML layout or to apply custom styling, you can specify the id of an HTML element where the IWML should be injected. Common choices include <div> or <span>, but any container element that can hold children will work.

 

Usage Notes:

The specified element must exist in the DOM before IntraWeb.js is loaded.

 

Example usage:

 

<body>

 <div id="MyApp"></div>

 

 <script src="/IntraWeb.js" data-Target="MyApp" data-Source="/Index.iwml"></script>

</body>

 

In this case, Index.iwml will render into the div with id="MyApp" instead of replacing the <body>.