JavaScript alternative to HTML tag?
-
Hello, So I have a website, lets call it site1.com, which is ALWAYS online. I also have another website (on a different server) that is only online part time, lets call it site2.com On site1.com, I want to load an image from site2.com. I'm currently using the standard HTML <img src="http://site2.com/image.png" alt="blah" />. The whole purpose of that image is to tell visitors on site1.com if the server at site2.com is online, and if it's not, it SHOULD show the alt text "blah". For the most part, this works in IE and FF, but not in chrome. In chrome I get chrome's standard 404 page in place of that image when the server is offline. What I want to do is write some JavaScript to put in place of the standard HTMl <img/> tag that will; 1. load (and display) the image from site2.com/image.png 2. if the image is not reachable, I want it to load an image from blah.com/external.png How would I go about doing this? Thankyou very much!
-
Answer:
According to the first discussion below it seems that short alt strings might work. The second link eventually proposes a solution using javascript and jQuery.
Kohlby at Yahoo! Answers Visit the source
Other answers
According to the first discussion below it seems that short alt strings might work. The second link eventually proposes a solution using javascript and jQuery.
Related Q & A:
- What is the alternative to an enterprise portal strategy in the Java space?Best solution by Programmers
- How to tag multiple friends into single image?Best solution by facebook.com
- Why is Javascript called Javascript, if it has nothing to do with Java?Best solution by Stack Overflow
- How to link websiteurl in anchor tag in jsp page?Best solution by Stack Overflow
- Why doesn't HTML have a "Slogan" tag?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.