Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38652
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | James Kirk <noneya.invalid@gmail.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: missing image error |
| Date | Tue, 4 Aug 2020 22:38:22 -0400 |
| Organization | Time Travel Tracing |
| Message-ID | <20200804223822.48ab12d7@james.kirk.invalid> (permalink) |
| References | <mICdnUE2Q-twd7XCnZ2dnUU7-fvNnZ2d@westnet.com.au> <hoskjfFefplU1@mid.individual.net> |
| Reply-To | ": James Kirk" <noneya.invalid+knobknocker@gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | solani.org; logging-data="24621"; mail-complaints-to="abuse@news.solani.org" |
| User-Agent | Unicorn named Ellie |
| X-Newsreader | Microsoft Windows Dead Mail Original Imitation Prototype |
| X-User-ID | eJwNxMEBgDAIA8CVpCSBdYDK/iPoPY4u0wREgcv1fQ7TeP+7C3UJdJzJ3MBG9ouiX2ltjPgAE8EQ1w== |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIHFgQpyK6L9AAAAEJQTFRFAAAAQAAAQEAAQEBAQECAgEBAgECAgIBAgICAgIC/gL+/v4BAv4CAv4C/v7+Av7+/v7//v////7+A/7+///+/////CTpitwAAAAF0Uk5TAEDm2GYAAAABYktHRBXl2PmjAAAB6klEQVRIx61Vi3KEIAz0pJZYUwIi//+r3QT78sTKTDM3N6e3y+5iIsPwT+UcdeHJOSd9Ao6kVyB2CqQkfQKpSI+AS6lDQh2VDoIzR6jYQVCBuymo7tH9EF+OUrwnAfxLFSjp/aajuZTbnujbUYop/dWz7P1kDyFWS4lYLuETyrs5VUKMSTyHthvFe/ZwFD8tRQ68SNvOxFlGh8hFl48oCoF9aOC9l23jB6n5GMHBR1gZfI7nvG2bf0hUL2YLNCWwf3Ilnip+Q2cX86+G8FM9MU/PgcmHDIaMZG6wflGKegLhyZQn4oxCBKlxTaHGBmHxz45ECRkRFFpX1+9UCQdPzHikRtBRiD8rzacEQjbFh5HKjixSzJco/kgQomyM5THvAoKFxXaLzgj40wj2FNSI2NW7pdbM/ritlbBOLu3rm0EnshOO3cHIAEZAIwG949ewvOqFX467ahIIsfJIltN2bF1XngQa/qxhWQkBEUTXzJWAGzCFKeKzaVDGpJllNwR84IlEiM/nIWRG54ERKrwSIDE3Jg57O7ooiVetYIX5o9gca2KcOzAUdnRtbEhcvMKAp/CrriTsoCKM2JenPAwzbr5dKWgYxUr+PoEvCCfq1DyBIf4iPYc8NQ5naUlQeynqJLRf9Z2E4cb58QHWYi4v2VmiigAAAABJRU5ErkJggg== |
| X-Rot13 | This message MAY contains rot13 encoded text that sensitive people may find offense, decode at your own peril. |
| Cancel-Lock | sha1:/4mYaS+uW4suJiQgY86bLSkfv+c= |
| Content-Language | en-US |
| X-Operating-System | Windows 3.0 |
| X-Content-Warning | The content of this message MAY contain controversial topics and SHOULD NOT be viewed by: sensitive individuals, malcontents, individuals under the age of 120, troglodytes, judgmental individuals, opinionated individuals or multi-cellular organisms. |
| Xref | csiph.com comp.lang.javascript:38652 |
Show key headers only | View raw
In Message: <hoskjfFefplU1@mid.individual.net>
Arno Welzel <usenet@arnowelzel.de> wrote:
> Andrew Poulos:
>> I'm dynamically adding images to a page using
[snip]
>> and the page works as expected. That is, when the image is not
>> available 'imagenotfound' is shown in its place.
>> The client tests the page with the console open and each time an
>> image is unavailable they see a 404 error. I've tried explaining
>> that it needs to error before it can know to replace it with
>> 'imagenotfound' but they would prefer that image's 404 error not
>> show.
>> Is there a way to trap the 404 so it doesn't show in the console?
>> Or is there some other way I can try to get the image and thereby
>> be able to trap the 404?
> No. That's the reason why there is a console - to see what is going
> on. Without trying to load an image and getting the 404 error the
> "onerror" attribute would not work at all.
> The only way to avoid 404 errors would be a wrapper script on the
> *server* which will either return the actual image or a placeholder
> if the image can not be loaded:
> <img src="server-side-loader?image=myimage.jpg" ...>
> Where "server-side-loader" is a PHP script etc. which will try to
> load the specificed image file and if this is not possible return
> the placeholder.
š¬šš«všš« ššØš§šš¢š š®š«ššš¢šØš§
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /img/.*\.(jpg|png|svg)$ [NC]
RewriteRule . /img/funnyClown.jpg [L]
If the server generates a listing.
Scrape the index for image links, then check images links for a
match.
--
Jšššš¤ ššš£š
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
missing image error Andrew Poulos <ap_prog@hotmail.com> - 2020-08-04 14:58 +1000
Re: missing image error Arno Welzel <usenet@arnowelzel.de> - 2020-08-04 10:29 +0200
Re: missing image error James Kirk <noneya.invalid@gmail.com> - 2020-08-04 22:38 -0400
Re: missing image error Arno Welzel <usenet@arnowelzel.de> - 2020-08-05 07:49 +0200
Re: missing image error Julio Di Egidio <julio@diegidio.name> - 2020-08-04 02:18 -0700
Re: missing image error Andrew Poulos <ap_prog@hotmail.com> - 2020-08-05 13:20 +1000
Re: missing image error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-08-05 08:44 +0200
Re: missing image error Andrew Poulos <ap_prog@hotmail.com> - 2020-08-05 18:02 +1000
Re: missing image error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-08-05 10:18 +0200
Re: missing image error Julio Di Egidio <julio@diegidio.name> - 2020-08-05 02:36 -0700
csiph-web