joomla3.0 - Joomla custom module add javascript -


i writing custom module , need add javascript site. individual page makes query database (the template makes nothing it)

i tried this:

define( '_jexec', 1 );  // defining base path. if (stristr( $_server['server_software'], 'win32' )) {     define( 'jpath_base', realpath(dirname(__file__).'\..\..' ));     } else define( 'jpath_base', realpath(dirname(__file__).'/../..' ));     define( 'ds', directory_separator );      // including main joomla files      require_once ( jpath_base.ds.'includes'.ds.'defines.php' );      require_once ( jpath_base.ds.'includes'.ds.'framework.php' );      // creating app instance      $app =& jfactory::getapplication('site');      $app->initialise();     jimport( 'joomla.user.user' );     jimport( 'joomla.user.helper' );       $jinput = jfactory::getapplication()->input;  $document = &jfactory::getdocument();    $document->addscript('modules/mod_csk/js/num.js'); 

but no javascript added site.

furthermore tried simple js code doesn't render:

echo "<td>"?><script type="text/javascript">alert("hello");<? echo "</td>" 

i don't know reason, maybe missed. simple page independent joomla system @ moment (so makes nothing switch off , on there settings) thank help.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -