Zach Lysobey
Zach Lysobey

Reputation: 15714

Prototype img src swap doesnt work in Firefox?

I was using the following code in a function activated onClick to swap an image (id=bigPicture). It worked great (in Chrome) and I moved on. I go into Firefox later to check and was flabbergasted when it didn't work as expected. The src does not change. Now, I am a noob when it comes to prototype so maybe this isn't the correct way to go about things. What do you folks think?

$(bigPicture).src = filename;

Upvotes: 1

Views: 961

Answers (1)

Shad
Shad

Reputation: 15451

String quote the element id~

$('bigPicture').src=filename;

Upvotes: 2

Related Questions