Sometimes images take some time to render in the browser. I want to show a busy image while the actual image is downloading, and when the image is downloaded, the busy image is removed and the actual image should be shown. How can I do this with JQuery or any javascript?
I'm currently working on a web application which has a page which displays a single chart (a .png image).  On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the chart in the middle of the page.  What I want to do is when a link is clicked on a page just the chart on the page is changed.  This will speed things up tremendously as the page is roughly 100kb large, and don't really want to reload the entire page just to display this.    I've been doing this via JavaScript, which works so far, using the following code  document.getElementById('chart').src = '/charts/10.png';   The problem is that when the user clicks on the link, it may take a couple of seconds before the chart changes.  This makes the user think that their click hasn't done anything, or that the system is slow to respond.  What I want to happen is display a spinner / throbber / status indicator, in place of where the image is while it is loading, so when the user clicks the link they know at least the system has taken their input and is doing something about it.    I've tried a few suggestions, even using a psudo time out to show a spinner, and then flick back to the image.    A good suggestion I've had is to use the following  &lt;img src="/charts/10.png" lowsrc="/spinner.gif"/&gt;   Which would be ideal, except the spinner is significantly smaller than the chart which is being displayed.  Any other ideas?
Fully charged MacBook Air turns off when power cord removed I have a MacBook Air, 2009, with a recently replaced Apple battery in December 2012. Recently, when power cord comes off, the computer shuts down. Also, it usually will not restart unless power cord is attached. No indent in the first paragraph in a section? Styling each feature of a layer individually I’ve a PostGIS table which is published as a Geoserver layer. Every feature in the table has some attributes that should style that feature (e.g color, size, opacity, external graphic url, ... etc).  I can create an SLD document and let it read its styling attributes from the table using &lt;PropertyName&gt;, but the problem is more complex than this, for example: some points features need to be styled as a simple circles, while some other need to be styled as external-graphic images. And from the SLD Reference, the SLD PointSymbolizer must have either &lt;Mark&gt; or &lt;ExternalGraphic&gt; element, for that reason I should create two rules one for the simple point symbolizer and the other for the external-graphic point symbolizer, and should add a filter to each rule so that it deals only with the appropriate features, something like:  &lt;FeatureTypeStyle&gt;     &lt;Rule&gt;         &lt;ogc:Filter&gt;             &lt;ogc:PropertyIsEqual&gt;                 &lt;ogc:PropertyName&gt;is-external-graphic&lt;/ogc:PropertyName&gt;                 &lt;ogc:Literal&gt;0&lt;/ogc:Literal&gt;             &lt;/ogc:PropertyIsEqual&gt;         &lt;/ogc:Filter&gt;         &lt;PointSymbolizer&gt;             &lt;Graphic&gt;                 &lt;Mark&gt;                     &lt;WellKnownName&gt;circle&lt;/WellKnownName&gt;                     &lt;Fill&gt;                         &lt;CssParameter name="fill"&gt;                             &lt;ogc:PropertyName&gt;fill-color&lt;/ogc:PropertyName&gt;                         &lt;/CssParameter&gt;                     &lt;/Fill&gt;                 &lt;/Mark&gt;                 &lt;Size&gt;6&lt;/Size&gt;             &lt;/Graphic&gt;         &lt;/PointSymbolizer&gt;     &lt;/Rule&gt;     &lt;Rule&gt;         &lt;ogc:Filter&gt;             &lt;ogc:PropertyIsEqual&gt;                 &lt;ogc:PropertyName&gt;is-external-graphic&lt;/ogc:PropertyName&gt;                 &lt;ogc:Literal&gt;1&lt;/ogc:Literal&gt;             &lt;/ogc:PropertyIsEqual&gt;         &lt;/ogc:Filter&gt;         &lt;PointSymbolizer&gt;             &lt;Graphic&gt;                 &lt;ExternalGraphic&gt;                     &lt;OnlineResource                xlink:type="simple"                xlink:href="smileyface.png" /&gt;                     &lt;Format&gt;image/png&lt;/Format&gt;                 &lt;/ExternalGraphic&gt;                 &lt;Size&gt;6&lt;/Size&gt;             &lt;/Graphic&gt;         &lt;/PointSymbolizer&gt;     &lt;/Rule&gt; &lt;/FeatureTypeStyle&gt;   My question is: Is there any better solution that is more dynamic? There exists an injection from $X$ to $Y$ if and only if there exists a surjection from $Y$ to $X$. Why does Linux show both more and less memory than I physically have installed? Should I postpone my trip to Paris in 2nd week of Jan in light of recent protests? I’ve a date and I really waited long to make this happen. My gifrfriend is a bit worried about the security issue in Paris. Which locals think that the media is exagerrating the issue and the issue is small and non-threatening for tourists? Arduino only works in root I've installed Arduino but as the title says, I can only upload with sudo. And yes my user is part of the dialout group so that's the weird thing.   Arduino did function before on my system. What could be wrong?  Output ls -l:  ls -l /dev/ttyUSB* crw-rw-rw- 1 root dialout 188, 0 apr  2 09:23 /dev/ttyUSB0 How to install Epson Perfection V600 Photo Scanner drivers Nature of the quantum degeneracy pressure It is commonly known that it is the electron degeneracy pressure that prevents the collapse of a white dwarf into a neutron star, and it is not the electromagnetic force. However, it is also widely accepted that all the forces in the universe are just manifestations of the four elementary forces in the universe. So can the degeneracy pressure, caused due to Pauli's Exclusion principle, be shown to be due to one of these forces? I have read some other questions in SE , , and they do not answer my question fully.  In one of the links, the degeneracy pressure is described as an 'entropic force', but as far as I understand, all entropic forces can be explained by the underlying fundamental forces. If the degeneracy pressure is something that is fundamentally different from the other forces, why isn't it classified as a separate force? What is the reason behind the multiple Spider-Man reboots? Spider-Man is the one franchise that is on course to a third reboot in a span of 15 years.   My question is what was the reason for these numerous reboots of Spider-Man which pretty much follow the same origin story for the Marvel superhero.  Has the comic creator or studio ever spoken out about the reasoning behind the same? How do I reverse a list using recursion in Python? I have a rechargeable vacuum cleaner with NiMH batteries, 1800mAh and 14.4 volts, 12 cells. The charger is 18v 200mA. The batteries have now died.  Can I replace the batteries with 4 cell Li-ion in series?   That will be 14.4 volts, if considered 3.7v each. Of course, I know it will be roughly 4 volts when fully charged.  Li-ion batteries in my mind: 18650, 2500mAh.  Also, can I charge them with the same charger? Problem in notation: $(\vec{v}\cdot\vec{\nabla})\vec{v}$ versus $L_v(\vec{v})$ I am wanting to find the correlation between two variables: a categorical vegetation variable (with categories 1-4)  and a continuous variable of erosion (with values anywhere between 0.2 and 9). I think I would be required to use a non parametric test to find the correlation, but bit of a newby to stats so could anyone suggest the best test to use? I also wanted to know how sample size can affect these tests, ie with a sample size of 100 or 1000? How is exponentiation defined in Peano arithmetic? How would exponentiation be defined in Peano arithmetic? Unless $n$ is fixed natural number, $x^n$ seems to be hard to define.   Edit 2: So, what would be the way to define $x^n+y^n = z^n$ using $\Sigma_1^0$ formula?  Edit: OK, I say Peano arithmetic has addition and multiplication stuffs. This allows additions to be expressed without quantifiers but as for exponentiation Peano arithmetic is silent. That's why I asked this question. Just for clarification. What is the reason that the value "47" is so popular in electrical engineering? command to zip multiple directories into individual zip files I have a single directory that contains dozens of directories inside of it.  I'm new to command line and I'm struggling to come up with a command that will zip each sub-directory into a unique sub-directory.zip file.  So in the end my primary directory will be filled with all of my original sub-directories, plus the corresponding .zip files that contain the zipped up content of each sub-directory.  Is something like this possible? If so, please show me how it's done. Uncertainty principle and multiple observers My understanding is that an observer can measure the precise location of a particle so long as the corresponding uncertainty in momentum measurement is not an issue and vice-versa.    Say there is such an observer, interested in the precise position of a particular particle.  Now, consider a second, independent observer, unbeknownst to the first, who is trying to measure the exact momentum of the same particle without caring about the position.  As a thought experiment, we assume that the two observers are somehow able to access the same particle at the same time in some way without being aware of each other.  Can both observers get their desired results? ShareLaTeX compilation flags Is it possible and if so how can you pass flags to the ShareLaTeX compiler which one would have passed as parameters to the LaTeX compiler?  I am using the minted package and need to pass the -shell-escape flag. How to get my actual data from ContentNote API in Salesforce using SOQL?