Is there any way something can override addScriptDeclaration ?

25 views
Skip to first unread message

rando...@gmail.com

unread,
Aug 13, 2017, 6:40:40 PM8/13/17
to Joomla! General Development
I have a simple module I've written with a simple tmpl/default.php :

<?php
// No direct access
defined('_JEXEC') or die;
// Header Manipulation
$document = JFactory::getDocument();
$document->addScriptDeclaration($orgData,FOOBAR);

I have installed this module on two Joomla 3.7.4 sites and it works beautifully.

I have installed this module on another Joomla 3.7.4 site, and it does not work.

Instead of

<script type=FOOBAR>

the final HTML rendered is showing

<script type="text/javascript">


Is there some way something in the template can be overriding my module's addScriptDeclaration ? Is there any way to force it through ?

Joe Palmer

unread,
Aug 16, 2017, 5:08:06 PM8/16/17
to Joomla! General Development
This should be able to do what you want:

https://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page#Add_Custom_Tag
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages