Posted by Jim Michaels on 01/22/06 09:55
"joksnet" <joksnet@gmail.com> wrote in message
news:1137008159.862213.129530@o13g2000cwo.googlegroups.com...
> Some example of dynamically create a script tag is:
>
> <script type="text/javascript">
> head = document.getElementsByTagName("head")[0];
> script = 0;
>
> function create_script(file){
> if(script){
> head.removeChild(head.lastChild);
> }
>
> s = document.createElement('SCRIPT');
> s.src=file;
> s.id='scriptCat';
> head.appendChild(s);
> script = 1;
> }
>
> create_script('foo.php?msg=something');
> </script>
>
> -----------------
> --- foo.php ---
> -----------------
>
> <?
> echo "alert(" . $_GET['msg'] . ");";
> ?>
I saw from another post that "short tags" may be deprecated.
[Back to original message]
|