You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/includes/_methods.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -523,36 +523,55 @@ Field Key | Example Value | Field Format | Purpose
523
523
524
524
When calling the insert method, the goal is to insert some markup into a location on the page. Once you have constructed the element(s) you wish to insert, you may call the `append` method to complete the process.
525
525
526
-
## API.loadJS(resourceUrl)
526
+
## API.loadCSS(resourceUrl)
527
+
528
+
The loadCSS method is a simple way to include an additional CSS stylesheet file required for your integration. The method returns a JavaScript Promise that resolves when the loading is complete. You may then insert markup that depends on that styling to avoid displaying a flash of unstyled content.
// Code to execute after your JavaScript file has loaded.
538
+
// Code to execute after your stylesheet has loaded.
537
539
});
538
540
})(window.DDC.APILoader);
539
541
```
540
542
541
-
The loadJS method is a simple way to include additional JavaScript files required for your integration. The method returns a JavaScript Promise which you can use to know when file loading is complete, to then run any necessary initialization functions, etc.
543
+
## API.loadJS(resourceUrl, attributeMap)
542
544
543
-
## API.loadCSS(resourceUrl)
545
+
The loadJS method is a simple way to include additional JavaScript files required for your integration. The method returns a JavaScript Promise which you can use to know when file loading is complete, to then run any necessary initialization functions, etc.
// Code to execute after your stylesheet has loaded.
555
+
// Code to execute after your JavaScript file has loaded.
554
556
});
555
557
})(window.DDC.APILoader);
556
558
```
557
559
558
-
The loadCSS method is a simple way to include an additional CSS stylesheet file required for your integration. The method returns a JavaScript Promise which you can use to know when stylesheet loading is complete, to then insert markup that depends on that styling to avoid display a flash of unstyled content.
560
+
> Usage with attributes
561
+
562
+
> In some cases your code may look for data attributes on the inserted script tag. In this case, you may use the following example as a guide to add the necessary attributes:
0 commit comments