How do I add "id" to script declaration

by user1148731   Last Updated October 01, 2017 00:10 AM

In the example below, the loaded script will appear in the 'head' with a plain 'script' tag but how do I add an id into the declaration so the result is something like 'script id="my-script"'

$document->addScriptDeclaration(' window.event("domready", function() { alert("An inline JavaScript Declaration"); }); ');

Tags : javascript


Related Questions





Create custom module with javascript .js

Updated November 25, 2016 08:04 AM

Joomla async and defer - Joomshaper

Updated March 10, 2017 03:10 AM