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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -