Local script Management
Mis à jour
Ce contenu vous a-t-il été utile ?
Mis à jour
Ce contenu vous a-t-il été utile ?
Ce contenu vous a-t-il été utile ?
The script management logic described on the previous pages can be used for JavaScript functions. You just have to wrap the latter to call it in the same way as a remote script.
<script>
console.log("demo");
</script>
becomes, when inserted in main source code:
<script>
function myScript() {
console.log("demo");
}
</script>
<script data-cmp-src="myScript"></script>
or via a Tag Manager:
<script>
function myScript() {
console.log("demo");
}
</script>
<script data-cmp-src="myScript"></script>
<script>try{Sddan.cmp.triggerTM();}catch(e){}</script>
<script>
(function() {
console.log("demo");
})();
</script>
becomes, when inserted in the main source code:
<script>
function myScript() {
(function() {
console.log("demo");
})();
}
</script>
<script data-cmp-src="myScript"></script>
or via a Tag Manager:
<script>
function myScript() {
(function() {
console.log("demo");
})();
}
</script>
<script data-cmp-src="myScript"></script>
<script>try{Sddan.cmp.triggerTM();}catch(e){}</script>
All the advanced features described on the next page are available when managing these scripts in your main page or via the Tag Manager.