I attempted to use your function but I get the following error. event has no properties element(undefined)prototype.js (line 2197) changeImage(undefined)main.js (line 27) onclick(click clientX=0, clientY=0)gallery.html (line 1) [Break on this error] return event.target || event.srcElement;
I have my javascript file externally linked in the head. Did you say that my problem could be due with the fact how I included my javascript and what order things are loading in? On Mar 17, 5:28 pm, Christophe Porteneuve <[EMAIL PROTECTED]> wrote: > OmenKing a écrit : > > > element has no properties > > That's because you put your Event.observe call at a point in time where > your DOM element has not been created yet. > > Likely in a script loaded from the head, but at the root level, not in a > function that gets called once the DOM is loaded. That's a common > mistake for people just starting to put their JS outside their HTML. > > If you look at my code in my previous reply, it'll bind your event in > response to window's load event: the DOM will be there then. > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
