I guess you need to include Prototype in the parent document too. BTW, use $$ to select elements in your document: $$('div') will give you any DIV element in your current document, almost like document.querySelectorAll; use $( id ) as a replacement of document.getElementById( id )
On Monday, July 15, 2013 10:14:05 PM UTC+2, Balaram Das Mahant wrote: > > I am new to Prototype, I have a webpage and an iframe in it. I am loading > Prototype in my iframe and am trying to use Selector API to get DOM > references for elements of my parent window. > Eg: > Selector.findChildElements(document,['div']) is returning references to > DIV elements of iframe's document. > But,Selector.findChildElements(parent.document,['div']) > is not returning any references to DIV elements of parent's document. > Instead, giving an error "TypeError: Cannot call method 'identify' of null". > When I deep dive into code, I find 'Element' is actually adding 'identify' > method (which is in my iframe context, which is addigning a dummy 'id' > attribute). First of all my understanding of Prototype and its Selector API > is poor, please suggest a way I can use Selector API to fetch references to > DOM elements of my parent document. > > Thanks in Advance. > -Balaram. > -- 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. For more options, visit https://groups.google.com/groups/opt_out.