add script tag in module joomla -
i new in joomla.i working on form submit in joomla..so have create 1 form creating module in joomla(please mention if there way create form , send email). user jquery form steps create form wizard..by following code in default.php in joomla default.php(mod_inquire folder)
$doc->addscript( juri::root() . 'modules/mod_inquiry/js/jquery.steps.min.js' );
i added css
$doc->addstylesheet( juri::root() . 'modules/mod_inquiry/css/jquery.steps.css' );
now question put script tag in defaul.php,some how added
<script> jquery(document).ready(function(){ alert(); jquery("#wizard").steps({ headertag: "h2", bodytag: "section", transitioneffect: "slideleft" }); }); </script>
but says .. jquery(...).steps not function...any appriciable...
you using wrong syntax including file.update path constant, use juri::root()
instead of juri:root()
. more detail check link : https://docs.joomla.org/juri/root
you can use addscriptdeclaration
add javascript code:
ex.
$document = jfactory::getdocument(); // add javascript $document->addscriptdeclaration(' jquery(document).ready(function(){ alert(); jquery("#wizard").steps({ headertag: "h2", bodytag: "section", transitioneffect: "slideleft" }); }); ');
Comments
Post a Comment