Re: Chrome, Safari, Konqueror dHTML issue

10 views
Skip to first unread message

Josh Powell

unread,
Mar 25, 2009, 5:18:06 PM3/25/09
to Prototype & script.aculo.us
$('myul') checks for elements with an id of myul, if you are looking
for classname, use:

$$('.myul')

On Mar 25, 1:55 pm, Vladimir Ghetau <vladimirghe...@gmail.com> wrote:
> Hi ,
>
> I was just testing this dynamically built structure...
>
> <div>
>    <ul id="myul"><li> .... some more tags here... </li></ul>
> </div>
>
> using code like...
>
> [code]
>
> var li_el = new Element('li');
> var ul_el = new Element('ul', {className: 'myul'});
>
> ul_el.appendChild(li_el);
>
> var div_el = new Element('div');
> div_el.appendChild(ul_el);
> [/code]
>
> Problem is, after attaching this to the xHTML document, I can't access
> the UL node using $('myul') in chrome, safari, or konqueror . It seems
> I can only access it if I only use the  "ul_el" var that I just
> declared above.
>
> In other words, how can I call dynamically generated HTML content
> using prototype inside chrome, safari or
> Konqueror?
>
> I'm trying to figure out what's missing, it works fine in IE or FF.
>
> Thank you!
> Vladimir Ghetau

ColinFine

unread,
Mar 26, 2009, 7:37:34 AM3/26/09
to Prototype & script.aculo.us


On Mar 26, 8:56 am, Vladimir Ghetau <vladimirghe...@gmail.com> wrote:
> Hi Josh,
>
> Sorry, what I meant there was new Element('ul', {id: 'myul'})

Are you sure that is the only element with id 'myul'? This sort of
problem is very often because browsers do not object to (illegal)
duplicated element id's, but then each behave differently if you try
to use them.

Colin
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages