Hi Jason,

I'm afraid that loading that child page into a div on the parent page
produces an invalid DOM tree, a document in which an ID is not
unique.  Gratuitous specs link:
http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2

Now, I'm not saying you won't get away with it a lot of the time, but
I would strongly advise against relying on that, no matter how much
you test.  Suppose it works just fine when you test it in Firefox
3.0.4 (for instance), but then they release 3.0.5 which just happens
(probably as a side effect of something else) to stop working with
these duplicate IDs in the way you intend...

You'll have to either 1) Change the parent page, 2) Change the child
page, or 3) Change the HTML as you're loading it into the div to
remove duplicate IDs.  Anything else is just a setup for a problem
down-the-line.

HTH,
--
T.J. Crowder
tj / crowder software / com

On Oct 21, 12:41 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> [code]
> parent page
> <ul id="tablist">
>   <li>Some text</li>
> </ul>
>
> child page(loaded in a div)
> <ul id="tablist">
>   <li>Child some text</li>
> </ul>
>
> [/code]
>
> [css]
> #tablist{
>     padding:3px 0;
>     margin-left:0;
>     margin-bottom:0;
>     margin-top:0.1em;
>     font:bold 12px Verdana, Arial, Helvetica, sans-serif;
>     border-bottom:1px solid gray;
>
> }
>
> #tablist li{
>     list-style:none;
>     display:inline;
>     margin:0;}
>
> [/css]
>
> This my code and css listing...
>
> On Mon, Oct 20, 2008 at 4:17 PM, T.J. Crowder <[EMAIL PROTECTED]>wrote:
>
>
>
> > Hi,
>
> > > considerations: 2 ul elements sharing id because of css styling.
>
> > Not really, right?  You mean they're sharing the same class or some
> > such?  You can't have two elements on a page with the same ID; IDs are
> > required to be unique across the DOM.
>
> > FWIW,
> > --
> > T.J. Crowder
> > tj / crowder software / com
>
> > On Oct 20, 12:40 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> > > [code]
> > > function monitorMgr(){
> > > var myLi=$$('ul.flMgr > li');
> > > myLi.each(function(liItem){
> > > Event.observe(liItem, 'click', anFunction, false);
>
> > > });
> > > }
>
> > > function anFunction(evt){
> > > alert($(evt).id);}
>
> > > [/code]
>
> > > response: undefined
> > > expected result: the clicked li's id
> > > considerations: 2 ul elements sharing id because of css styling.
> > > This page is loaded in a div residing in another page 'parent page'.
>
> > > Which way out?
> > > Regards
> > > -jason
>
> > > --
> > > Sent from Gmail for mobile | mobile.google.com
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to