Greetings,
for the following webpage I created a piece of Javascript to fill in the missing images:
Link
Code:
var imageGet = document.getElementsByClassName('art');
var i = imageGet.length;
var a;
while (--i>=0)
{
a = imageGet[i].parentNode.parentNode.getAttribute('href');
if (a.indexOf('/Larks%27+Tongues+in+Aspic') > -1)
{
imageGet[i].src = 'http://i1325.photobucket.com/albums/u622/last_fm_projeKct/Last%20FM%20covers/64%20x%2064/ltia.jpg'
};
if (a.indexOf('/Three+of+a+Perfect+Pair') > -1)
{
imageGet[i].src = 'http://i1325.photobucket.com/albums/u622/last_fm_projeKct/Last%20FM%20covers/64%20x%2064/3oapp.jpg'
};
};
While this actually does what is supposed to happen, I was wondering if there's a neater way of including more possible strings for the indexOf()-function, without making a new 'if'-statement for every piece of string I'd want to include eventually.
Thanks for taking the time to read this.
Cheers!