Annoyed with those red-x symbol appering everytime you have a broken image? The ugly
will only appear if you’re browsing with IE (In Firefox, nothing will appear if any image is broken). So… how do you get rid of it? Here’s the simple way…
- First, you will need to paste the following codes inside the <head> section of your page;
<script language="JavaScript" type="text/javascript">
function ImageLoadFailed() {
window.event.srcElement.style.display = "None";
}
</script>
- And then all you have to do is to include the following codes in you image code;
<?php if (ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) { echo 'OnError="ImageLoadFailed()"'; } ?>
- …which will make your image code looks something like this;
<img src="maybebroken.gif" alt="" <?php if (ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) { echo 'OnError="ImageLoadFailed()"'; } ?>>
Commenters: dnnya
1 Comment
»
Leave a comment
ajwa . Naj . Wawa . 26 . 












Thanks.. ;-)