When you're using script/style tags, always try to use the appropriate
type attribute:

<code>
<script type="text/javascript"></script>
<style type="text/css"></style>
</code>

>From what I understand, javascript in IE is run after the page is
loaded ("ready"), which is AFTER the load event. Meaning, if you put a
script call inside the body and that script call manipulates the DOM
(such as changing the innerHTML of a particular element on the page),
you'll get an error.

You can, however, put it at the very bottom of the BODY tag and it
will run correctly, or, if it's not used during load, put it wherever
you feel like. Just remember, load in IE prevents DOM manipulation
until AFTER the BODY tag is loaded.

On Nov 21, 2:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I'm just a beginner of javascript.
>
> I'm just wondering how browser Engine works..
>
> in this article i just consider about two main part of browser Engene.
>
> the first one is html parser, and the other part is javascript
> interpreter.
>
> as i know html parser parses html  line by line.
>
> I use inline javascript between HTML object like this line
>
> so when tag is opend such as <div> ,
>
> it is looking for the tag closed like </div>
>
> and then the dom object is created on the screen.
>
> what if i use <script> in the middle of HTML page??
>
> ex)
> <div>
> <script>func1()</script>
> </div>
>
> I've found that
>
> it looks like  HTML parser stop working while func1 is excuting..
>
> however it's working actually it's wating for the  pair .
>
> i think it is because <script> is also a kind of dom object.
>
> so parse is wating for </script> ...
>
> but but but but but..
>
> before excution of func1 is fully finished,
>
> the script block is not closed.
>
> usullay, this kinda problem is not that big issue.
>
> in case func1 takes lots of time, it can be a big problem.
>
> It looks like it's loading very slowly..
>
> what should i do???
>
> I just did this.
>
> settimeout(func1,1);
>
> yeah I think it's kina nice way to optimize the page..
>
> if I use 'settimeout', javascript interpreter just allocate the func1
> to the browser memory .
>
> in addtion, the <script>block is closed quickly and html parse can
> keep working.
>
> here's the question.
>
> when html parser is making dom tree. the func1 in the browser memroy
> will be excuted.
>
> then,,,,,,do they work at the same time ?? or javascript interpreter
> intercept the priority?????

Reply via email to