If I want to add JavaScript in the head tag, I use drupal_add_js($js, 'inline')
. This will add a <script type="text/javascript">
.
How do I add the <noscript>
tag? I want to add the following in <head>
also.
<noscript> <meta http-equiv="refresh" content="5;url=<?php echo $file ?>" /> </noscript>
BTW, I’m using a simple module for this.
function custom_download_menu() { $items['download-code'] = array( 'title callback' => 'custom_download_page_title', 'page callback' => 'custom_download_view', 'access arguments' => array('access content'), 'access callback' => TRUE, ); return $items; } function custom_download_view() { $js = "var time_left = 5; var cinterval; function time_dec(){ if(time_left > 0) time_left--; document.getElementById('countdown').innerHTML = 'Your download will start in ' + time_left + ' seconds...'; if(time_left < 1){ clearInterval(cinterval); window.location = '<?php echo $file ?>'; } } cinterval = setInterval('time_dec()', 1000);"; drupal_add_js($js, 'inline'); }