script DOM element

5 views
Skip to first unread message

Sara

unread,
Dec 1, 2008, 7:44:48 PM12/1/08
to CS193H High Performance Web Sites
Hi,

I am using the following code which was mentioned in the class for
avoiding blocking of the javascript.
var se = document.createElement('script');
se.src = 'target_files/triggerParams_270148.js';
document.getElementsByTagName('head')[0].appendChild(se);

I removed this code:
<script type="text/javascript" src="target_files/
triggerParams_270148.js"></script>
from the htm file and used the creatElement code. Now the problem is
that when the page is rendered the three lines on the top are shown on
the page. I am using Firefox.
Any ideas what is wrong?

Thanks,
Sara

Eric Lovett

unread,
Dec 1, 2008, 7:46:44 PM12/1/08
to cs193...@googlegroups.com
Did you wrap those lines in the following?

<script type="text/javascript">
...
</script>

Eric Lovett
etlo...@gmail.com
Cell: (503) 504-6998

Sara

unread,
Dec 1, 2008, 7:55:12 PM12/1/08
to CS193H High Performance Web Sites
Thanks! Problem solved.

On Dec 1, 4:46 pm, "Eric Lovett" <etlov...@gmail.com> wrote:
> Did you wrap those lines in the following?
>
> <script type="text/javascript">
> ...
> </script>
>
> Eric Lovett
> etlov...@gmail.com
> Cell: (503) 504-6998
Reply all
Reply to author
Forward
0 new messages