Moti Mashiah
asked on
Html and asp.net mvc
HI Guys,
I'm showing picture in my html page in this way:
The issue I have is when the picture doesn't exist I would like to alt="There is no picture" message.
I'm getting the message but I'm getting also little thumb nail which I don't need.
There is work around it to make just the message to appear in case picture doesn't exist?
Thanks,
I'm showing picture in my html page in this way:
<img src="smiley.gif" alt="There is no picture" width="42" height="42">
The issue I have is when the picture doesn't exist I would like to alt="There is no picture" message.
I'm getting the message but I'm getting also little thumb nail which I don't need.
There is work around it to make just the message to appear in case picture doesn't exist?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for the idea.
Here is how I solved it.
var img = document.getElementById("m yImg");
img.onerror = function () {
this.style.display = "none";
}
Here is how I solved it.
var img = document.getElementById("m
img.onerror = function () {
this.style.display = "none";
}
ASKER
Can you send some code example?
Thanks,