Place this code anywhere in a custom extension to load an external JS dependency:
$wa = Factory::getDocument()->getWebAssetManager();
$wa->registerAndUseScript('sesame.stripepay', 'https://js.stripe.com/v3/');
Should add <script src="https://js.stripe.com/v3/" data-asset-name="sesame.stripepay"></script>
to the HTML <head>
.
But adds <script src="/joomla/root/path/https://js.stripe.com/v3/" data-asset-name="sesame.stripepay"></script>
to the HTML <head>
.
This results in a 404 when fetching the JS external asset which leads to JS errors if the asset is used and called afterwards.
The issue is created here:
joomla-cms/libraries/src/WebAsset/WebAssetItem.php
Lines 179 to 182 in aa475c1
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-20 15:45:45 |
Closed_By | ⇒ | joomdonation |
Close because it is duplicate with the one I opened earlier