I'm sorry if this is not exactly what you asked but I'm going to try and
point out a few problems and see if that answers your question.

Firstly you cannot declare a src attribute and put javascript in the same
<script> tag

You do not need to re-extend the variable "t" after you have created a new
Element - it is already extended.

You have your statements out of order which is why it is probably not
working. You are adding "t" to $('div') immediately instead of building the
entire contents of "t" then inserting into "cont"


Try this



<div id='div'></div>
<script src="javascript/ie7.js"></script>

<script>
var cont=$('div');
var t=new Element('table',{'width':'200px'});
var tr=new Element('tr');
var td=new Element('td').update('hello');
tr.insert(td)
t.insert(tr);
cont.insert(t);
</script>






Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com


On Sat, May 11, 2013 at 10:36 AM, Александр Павленко <aleksl...@gmail.com>wrote:

> Почему не работает такой код IE7
>
> <div id='div'></div>
> <script src="javascript/ie7.js">
> var cont=$('div');
> var t=new Element('table',{'width':'200px'});Element.extend(t);
> cont.insert(t);
> var tr=new Element('tr');Element.extend(t);
> var td=new Element('td').update('hello');Element.extend(t);
> t.insert(tr);
> tr.insert(td)
> </script>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prototype-scriptaculous+unsubscr...@googlegroups.com.
> To post to this group, send email to
> prototype-scriptaculous@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prototype-scriptaculous+unsubscr...@googlegroups.com.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
Visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to