S
S
seredaes2016-08-22 16:25:12
PHP
seredaes, 2016-08-22 16:25:12

Absolute path of joomla3 in addScript?

$document = JFactory::getDocument();
$document->addScript(JURI::root().$url);
I specify the absolute path when connecting libraries. But the customer says that his test site, which I don't have access to, uses a relative path.
For example:
example.com/xxx/yyy/index.html
$document->addScript("template/js/1.js");
the template folder is located at the root and from the url: /xxx/yyy/index.html it seems to me that it cannot be accessed using just template/js/1.js.
The addresses are generated by the sh404sef plugin.
Maybe there's a secret here?
Prove that you need to specify only absolute paths or tell me where and what to adjust so that the script is available by specifying only a relative path...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question