Drupal - How do I add the <noscript> tag in <head>?
You can add elements to the <head>
section of a web page using drupal_add_html_head()
.
$target = url('enable-javascript', array('absolute' => TRUE));
$meta = array(
'#theme' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'http-equiv' => 'refresh',
'content' => "2; url=$target"
)
);
$noscript = array(
'#theme' => 'html_tag',
'#tag' => 'noscript',
'#value' => drupal_render($meta)
);
drupal_add_html_head($noscript, 'noscript');
API Documentation