View Single Post
Old 11-06-2012, 11:47 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
So you want to use the location.pathname stored in currentLink as a key to the "dictionary" object literal to retrieve the new image src?

Try this
Code:
albumCover[0].src = dictionary[currentLink];
Explanation: You have to use an index (e.g. [0]) on albumCover because getElementsByClassName always returns a collection of elements with the same class even if there's only one such element on the page.
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
WhatABoringName (11-06-2012)