Quote:
Originally Posted by markscotland
Is it possible to use JavaScript to locate all of the "smiley sad Icon.jpg"'s and output the location within the table?
Such as A3, and B2.
Thank you in advance. 
|
Making a WGET script, huh?
This should get you started:
Code:
<script type="text/javascript">
var findImg = function(name) {
var e = document.getElementsByTagName('img');
var i = e.length; // how many img elements total
var str = '';
while (i--) {
if (e[i].src.indexOf(name) != -1) // if match...
str += e[i].src + '\n'; //...copy to str with a newline
}
alert(str); // display all matches
}
findImg('smiley%20sad%20Icon.jpg'); // call the function with the name to be matched
</script>
All this does is find anything which matches the input to the function and pops it up in an alert window. But all the stuff is there so get you started.
You may want to stick something like
.toLowerCase() on the search string and the filename strings so that they match the name even if the case doesn't match.
Have fun.....
-- Roger