My code is: var getDoc = (Prototype.Browser.Gecko) ? $(''wysiwyg'' + this.textareaID).contentDocument : $(''wysiwyg'' + this.textareaID).document; getDoc.body.setStyle({ fontSize: ''13px'', fontFamily: ''Verdana, Arial, Helvetica, sans-serif'' }); If I use getDoc.body.style.fontSize = "13px"; getDoc.body.style.fontFamily = "Verdana, Arial, Helvetica, sans- serif"; it works fine. update() also doesn''t work. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ruan, I think you''re running into a cross-frame issue combined with a scoping issue (this). I had a similar one a while back when I was doing a file browser with a popup window. (do a search) My suggestion is to include prototype.js in the iframe and have a method in the iframe that you call from the parent document to do your bidding. Gareth On Feb 5, 2008 11:31 PM, Rauan Maemirov <rauan1987-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > My code is: > > var getDoc = (Prototype.Browser.Gecko) ? $(''wysiwyg'' + > this.textareaID).contentDocument : $(''wysiwyg'' + > this.textareaID).document; > > getDoc.body.setStyle({ fontSize: ''13px'', fontFamily: ''Verdana, Arial, > Helvetica, sans-serif'' }); > > > If I use > getDoc.body.style.fontSize = "13px"; > getDoc.body.style.fontFamily = "Verdana, Arial, Helvetica, sans- > serif"; > > it works fine. > > update() also doesn''t work. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It didn''t help me. :( Maybe something else? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Rauan Maemirov wrote:> My code is: > > var getDoc = (Prototype.Browser.Gecko) ? $(''wysiwyg'' + > this.textareaID).contentDocument : $(''wysiwyg'' + > this.textareaID).document; > > getDoc.body.setStyle({ fontSize: ''13px'', fontFamily: ''Verdana, Arial, > Helvetica, sans-serif'' }); > > > If I use > getDoc.body.style.fontSize = "13px"; > getDoc.body.style.fontFamily = "Verdana, Arial, Helvetica, sans- > serif"; > > it works fine. > > update() also doesn''t work. >Your body element is not extended. try $(getDoc.body) instead of getDoc.body - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> Your body element is not extended. > > try $(getDoc.body) instead of getDoc.body > > - Ken SnyderI''ve already tried it. but it returns the same result. Element.extend(getDoc[.body]) also didn''t help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Rauan Maemirov wrote:>> Your body element is not extended. >> >> try $(getDoc.body) instead of getDoc.body >> >> - Ken Snyder >> > > I''ve already tried it. but it returns the same result. > Element.extend(getDoc[.body]) also didn''t help. >As Gareth said, you''ll have to include prototype in the iframe or popup window. If getting the body is tricky (e.g. with quirksmode and stuff) try using $$(): $$(''body'')[0] - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---