I have seen code for replacing a broken image with javascript using onerror, but I have a situation where I'm not sure what image is going to be available for a replacement, so I need to do multiple checks and I'm not sure how... Here's an example of what I need...  &lt;img src="http://www.example.com/myimage1.png"&gt;  If that image isn't available, I need to check a different location for an image.  that location will be...  &lt;img src="http://www.example.com/myimage2.png"&gt;  If that image isn't available, I need to check,  &lt;img src="http://www.example.com/myimage3.png"&gt;  and finally, if that image isn't available, I use my default image that I know is always available  &lt;img src="http://www.example.com/default.png"&gt;  javascript only please, no jquery
I have a web page that includes a bunch of images. Sometimes the image isn't available, so a broken image is displayed in the client's browser.  How do I use jQuery to get the set of images, filter it to broken images then replace the src?    --I thought it would be easier to do this with jQuery, but it turned out much easier to just use a pure JavaScript solution, that is, the one provided by Prestaul.
A bounce-rate attack to manipulate SEO? This is a question to experienced people that might help us shed some light on the issue.   We noticed a very strange behavior on our site, in Google Analytics. Some dude from Finland, namely, from Kouvola city is hitting one of our pages - only one page on our site, 'bout a hundred times per day, all with an average bounce rate of 90%+...  This is causing our overall bounce rate to go up by 1 to 3% per day... which is very disturbing.. since we're trying to do our best in order to keep it as low as possible. And obviously having it jumped from ~24% to 27%, just because of that crazy dude is not making us happy at all... We tried implementing a geo-targeted script in order to catch this particular visitor and deliver him a juicy message, and it seemed like it helped in the beginning, it has stopped for a day or two, but now he's back...   The geo-targeted script was also logging all IP addresses for page requests originating from Finland in order to find out more details and (in order to block them on the server level, later).. but thing is, it was all mainly cable or DSL connections with various, but not constantly repeating IPs... we are all wondering what is he up to really ?   I think that this page should be kept updated with ideas on how to combat this and perhaps someone could also shed light on what it might be ? What is the reason for doing this "bounce-rate attack", as I call it?  There was a similar question asked on stackoverflow earlier, with no meaningful answer - here - Applied modifiers are not visible I'm wondering what the preferred method is for dealing with AJAX calls. Should one use the same plugin php file to process the POST or a separate one? Which is cleaner or safer? PHP: running scheduled jobs (cron jobs) I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?  What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.  This is just a quick example of what I was thinking about:  if ($alreadyDone == 0 &amp;&amp; time() &gt; $timeToRunMaintainance) {    runTask();    $timeToRunMaintainance = time() + $interval; }    Anything else I should take into consideration or is there a better method than this? The future of meta.stackoverflow and meta.stackexchange Historically this site, , has been the place to ask questions about not just Stack Overflow, but the functioning of the entire Stack Exchange (2.0) network, including Area 51 and stackexchange.com and careers.  (Yes, there was a , but that dealt with the old legacy Stack Exchange 1.0 sites. It was deprecated a while ago, and currently redirects here.)  Now that we've gotten many, many months under our belt from the SE 1.0 days, I think it's time that we gave Stack Overflow its own, true per-site meta, and moved the higher level network meta discussions to meta.stackexchange.com.  Over time, it's begun to bug me more and more that requests for Stack Overflow, the site, kind of get buried here on meta.stackoverflow under the avalanche of network issues. Retag requests, synonym requests, things truly specific to Stack Overflow, the site, not the network. This is unfair to our vastly largest and flagship Q&amp;A site, and it's unfair to the Stack Overflow users to mix their requests in with network level concerns.  It's also odd that Stack Overflow is the only network site without a proper, dedicated per-site meta, where its meta has its own reputation system not tied to the parent site in any way.  This is mostly a quirk of history more than anything else, and I believe it is now an appropriate time to split into two sites:   , a proper per-site meta for Stack Overflow with integrated rep , a global network meta with its own reputation system   Yes, this will be painful. But I believe it is a good, necessary, and healthy step both for the future of the network and the future of Stack Overflow.  Some things to discuss:   which questions should be migrated from here to meta.so? Obviously site-specific things like the retag-requests, and perhaps questions with the  tag. Anything that is 100% wholly specific to Stack Overflow and not generalizable to the rest of the network should be moved over. This may be a pretty small, narrow list of questions, and that's OK. Should we do some meta spring cleaning in our transition? Which questions / tags should be blown away as no longer relevant, referring to ancient versions of Stack Overflow or issues that have long since ceased to exist and aren't instructive for any future visitors? Your meta reps will generally be unaffected, except insofar as we delete for spring cleaning, or move site-specific things to meta.so. We still plan to have a distinct reputation system for the new meta.se site, just like here.   I do not have a timeline for this change, that is up to Jarrod and David to decide. It may be months away. However, we feel pretty strongly that this is something that we need to do to clean things up and pave the way for the future -- so I expect it will happen in the next few months, giving us lots of time to decide how we want to do it, per the above.  Update  . When to use RSA and when ElGamal asymmetric encryption Can I play Minecraft Java if I only buy the Windows 10 version I do not own Minecraft outside my PS4, I know I can't play either Windows 10 or Java with that purchase. However, my primary computer is Linux and only supports the Java edition, and its past the deadline to get a redeem code for Windows 10 edition if I purchase the Java Edition.    Can I purchase the Windows 10 edition and use that purchase to login and play on the Java edition? Do I need to use a comma between two adjectives? You can also contact me to customize your template, or create a new unique one.   Do I need to put a comma between the new and unique adjectives in this sentence?  In my native language (if I am not mistaken) we don't put a comma if the adjectives are of a different type. Not sure about English though, and if it's the case here anyway. Any help would be appreciated! USB-C Dongles killing Wifi on 2016/2017 MacBooks – Who’s to blame? I recently switched from my beloved MacBook Pro Retina (Late 2013) i5 2.6/16/512 to MacBook Pro (2017) Non-TB i5 2.3/16/512.  I purchased what from the build-quality looked like a good USB-C-to-DisplayPort cable with 4k/60Hz support, just to run into the very problem the Logicboard repair guru Louis Rossmann had described in : As soon as you plug in the USB-C dongle, the (2.4 GHz) Wifi stops working despite full antenna signal. Unplug the USB-C connector and you are immediately back in the game.  The big question I'm asking myself now: Who is to blame? Is this a design flaw in the current generation MacBooks with improper shielding or is it a design flaw in the various dongles?  I mean the fact that even Apple’s very own USB-C Digital AV Multiport Adapter is causing these WiFi issues (as you can learn from the many horrific ; but AFAIK have been fixed through a ), show that there’s something going horribly wrong. Please do not "lie" that the Community user "modified" the question If the Community user bumps a question, It says It has modified it:    However, It did not really modify the question, It rather just visited it. The word "modified" is a bit unfortunate IMHO because it suggests that something changed in the question or its answers, which is not true. I therefore suggest that we look for another word which would be more descriptive and less confusing. Some come to my (and others') mind:   visited, poked, bumped, promoted, dredged up, brought up, ...   (Actually, "Bumped" is even officially used now:  and .)  I'm not a native speaker and maybe someone find a better word. To me, visited sounds the best, but that may be only me. It makes sense, too, since Community really just visits the questions, with the site-effect of them getting bumped. It shouldn't confuse anybody.  Actually, it can be harmful in some sense, since , and it is interesting to know that this has happened, so that more people can check that the edit makes sense. You therefore can't simply ignore all "edited by Community" messages. (Thanks to Monica Cellio for pointing it out.)  (Remark: I know this has been questioned before (    ) but I think it has never been requested to change the action title to something more descriptive. If I'm wrong, I apologize.) (The "lying" it the question title is meant as a sarcasm) Any thoughts on how one might clear the Android Marketplace search history? For instance, if I recently searched for an android app in the marketplace, the marketplace search maintains a history list of which apps/keywords that I have recently looked for.    Thanks in advance! How was Dumbledore able to defeat Grindelwald, since Grindelwald had the Elder Wand? Converting spoken word audio files into text I've been working on transcribing a lecture series from audio to text files.  There are just over 20 lectures, and each one is about an hour long.  Using VLC Player, I'm able to slow down the speaker's words to a rate that I can keep up with.  However, it's extremely slow going, and it takes so much concentration that I can barely get through a third of a lecture before I have to take an extended break.  The thought had occurred to me that I would be better served by using some kind of speech recognition software, and then proofreading the computer-generated result.  This is likely to be a one-time thing, so while I don't mind using commercial software to get the job done, it would be preferable if it wasn't too expensive (or free; free is always good).  Command-line solutions are fine, too (:  Any suggestions? Story about workers repeatedly doing trivial work I'm trying to remember a (short) story I read in school some time ago. I don't have much, but here it is:   Numbers of workers are assigned to trivial task, like changing broken lightbulbs (or something similar). Once they finished their daily work, another group of workers are putting the broken lightbulbs in again, allowing for an endless, trivlal working circle.   I know that isn't much, but maybe someone has an idea, thanks. How to execute code after html form reset with jquery? How far can one get in analysis without leaving $\mathbb{Q}$? Suppose you're trying to teach analysis to a stubborn algebraist who refuses to acknowledge the existence of any characteristic $0$ field other than $\mathbb{Q}$.  How ugly are things going to get for him?  The algebraist argues that the real numbers are a silly construction because any real number can be approximated to arbitrarily high precision by the rational numbers - i.e., given any real number $r$ and any $\epsilon&gt;0$, the set $\left\{x\in\mathbb{Q}:\left|x-r\right|&lt;\epsilon\right\}$ is nonempty, thus sating the mad gods of algebra.  As @J.M. and @75064 pointed out to me in chat, we do start having some topology problems, for example that $f(x)=x^2$ and $g(x)=2$ are nonintersecting functions in $\mathbb{Q}$.  They do, however, come arbitrarily close to intersecting, i.e. given any $\epsilon&gt;0$ there exist rational solutions to $\left|2-x^2\right|&lt;\epsilon$.  The algebraist doesn't find this totally unsatisfying.     Where is this guy really going to start running into trouble?  Are there definitions in analysis which simply can't be reasonably formulated without leaving the rational numbers?  Which concepts would be particularly difficult to understand without the rest of the reals? If the topology of a space  has a countable base, then each base contains a countable subfamily which is also a base. Changing the resistor to be in front or behind an LED doesn't affect brightness? Need to delete a directory with name '~' created accidentally There exists an injection from $X$ to $Y$ if and only if there exists a surjection from $Y$ to $X$.