JDocument::addScript
Adds a linked script to the page
Signature
public function addScript(string
$url,
[string
$type = "text/javascript",
[boolean
$defer = false,
[boolean
$async = false]]] )
Parameters
-
$url
- URL to the linked script
-
$type
- Type of script. Defaults to 'text/javascript'
-
$defer
- Adds the defer attribute.
-
$async
- Adds the async attribute.
Returns
- JDocument
- instance of $this to allow chaining