javascript - Dynamically loading images with unknown image type, JS, HTML -
so, have chrome extension. scrapes page looking phrases (such 'smile') , replaces them image stored locally same name ('smile').
the problem is, have ~1k images mixture of .gif, .jpg , .png
so not sure of efficient way load image proper src location.
idealy have try smile.gif, smile.jpg , smile.png until found 1 right don't want crazy overhead
to clarify, know how detect reference words in text -> gives me part of filename (for example 'smile') -> have no way know @ point whether 'smile' stored locally jpg/png/gif can't direct <img src=....
exact right location.
would possible go through directory , create json filename: extension, , reference this? assuming can't in javascript though
any suggestions?
Comments
Post a Comment