You might try this:<br>drupal_set_html_head("<script src='<a href="http://example.com/test.js">http://example.com/test.js</a>' type='text/javascript'></script>");<br><br><br><br><div class="gmail_quote">
On Jan 23, 2008 3:10 AM, Alex Moreno <<a href="mailto:al3xmor3no@gmail.com">al3xmor3no@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks a lot for your answers. I´ve tested this:<br><br>hook_init("<script></script>");<br><br>and the drupal_add_js, but i don´t need to just insert a library but<br>also insert some pieces of code to force the execution when the page
<br>is loading and inserting some params from the drupal database.<br>Someting like this:<br><br>print '<script type=text/javascript>function mainload(){mostrar(' .<br>$latitude . ',' . $longitude . ',"' .$msg.'");}</script>';
<br><div><div></div><div class="Wj3C7c"><br><br><br><br>On 22/01/2008, Tao Starbow <<a href="mailto:starbow@citris-uc.org">starbow@citris-uc.org</a>> wrote:<br>> You can use hook_init, but you need to check if you are serving a cached
<br>> page or not. Just check for the existence of some function that will<br>> only be there on a full bootstrap. I am assuming you are talking about<br>> Drupal 5. In Drupal 6 you don't need to do the check (and, last time I
<br>> tested, drupal_add_js wasn't working in hook_footer in Drupal 6).<br>><br>> cheers,<br>> -tao<br>><br>> Alex Moreno wrote:<br>> > Hi everybody,<br>> ><br>> > i´m trying to insert a javascript line from a custom module. I´ve seen
<br>> > the hook_footer module and it does exactly what i need but not in the<br>> > header section as i need.<br>> ><br>> > a link t some code should be a great help.<br>> ><br>> > thanks a lot in advance.
<br>> ><br>><br><br><br></div></div><font color="#888888">--<br>Alejandro Moreno López<br>Publicidad en Buscadores y Marketing Online<br><a href="http://www.tdo.es" target="_blank">http://www.tdo.es</a><br></font>
</blockquote></div><br>