dnedrow-ee4meeAH724@public.gmane.org
2008-May-24 21:35 UTC
prototype causing value undefined error
I have a project for which I used a Wicket template as a starting point. The original example uses prototype.js. I''m using an SVG image as a background and have included a javascript that causes the image to always fill the background, regardless of the client window dimensions. This works fine in Safari 3 (Firefox doesn''t display the background image, but I''ll deal with that some other time), but all browsers exhibit the same behavior. If I include prototype.js, I get a "value undefined" error re: the inline resizing script: TypeError: Value undefined (result of expression $(document).ready) is not object. The error points to the last line of the inline script, });. This is line 35 in page.html. At this point, the image is simply displayed at it''s native size and does not resize If I comment out prototype, there is no error and the resize works as expected. I''ve uploaded a zip of a tiny example to demonstrate the problem. You can grab it at... http://nedron.net/bgtest.zip Any help or pointers would be appreciated. -David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dnedrow-ee4meeAH724@public.gmane.org
2008-May-24 21:37 UTC
Re: prototype causing value undefined error
On May 24, 5:35 pm, dned...-ee4meeAH724@public.gmane.org wrote:> I have a project for which I used a Wicket template as a starting > point. The original example uses prototype.js. > > If I include prototype.js, I get a "value undefined" error re: the > inline resizing script: > > TypeError: Value undefined (result of expression $(document).ready) is > not object. > > I''ve uploaded a zip of a tiny example to demonstrate the problem. You > can grab it at... > > http://nedron.net/bgtest.zipUncomment the prototype.js line in page.html to generate the error. I forgot to mention that. -David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sat, May 24, 2008 at 3:35 PM, <dnedrow-ee4meeAH724@public.gmane.org> wrote:> > ... > TypeError: Value undefined (result of expression $(document).ready) is > not object. > ... > > Any help or pointers would be appreciated. > > -David$(document).ready() is a jQuery function that is likely getting overwritten by Prototype. You''ll need to use jQuery''s no conflict mode if you want both libraries to play nice together. http://docs.jquery.com/Using_jQuery_with_Other_Libraries - 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 -~----------~----~----~----~------~----~------~--~---
On May 24, 2008, at 6:08 PM, Ken Snyder wrote:> > $(document).ready() is a jQuery function that is likely getting > overwritten by Prototype. You''ll need to use jQuery''s no conflict > mode if you want both libraries to play nice together.Ken, Thanks for the help. That was it. The information from the URL you provided gave me the workaround. Now, I just need to figure out why Firefox doesn''t render the image. Thanks again, -David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---