Replace a not existing img
How do I make an replace a not existing img?
With the jQuery error function. What is a replace a not existing img? How do you make a replace a not existing img? This script and codes were developed by Gabriel on 18 July 2022, Monday.
Replace a not existing img - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>replace a not existing img</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { padding: 20px; font-family: sans-serif;
}
img { margin-top: 15px; -webkit-border-radius: 10px; -moz-border-radius: ; border-radius: ;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h1>replace a not existing img</h1>
<p> Change the src of this img and you will see the magic. <br /> (e.g. ".com" → ".uk") <br /> <img src="http://www.placecage.com/g/400/400" /> <!-- edit this ^ here -->
</p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Replace a not existing img - Script Codes CSS Codes
body { padding: 20px; font-family: sans-serif;
}
img { margin-top: 15px; -webkit-border-radius: 10px; -moz-border-radius: ; border-radius: ;
}
Replace a not existing img - Script Codes JS Codes
$("img").error(function () { $(this).attr("src", "http://placehold.it/400x400.png&text=no%20image%20found");
});
Developer | Gabriel |
Username | gab |
Uploaded | July 18, 2022 |
Rating | 3 |
Size | 2,026 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Css3 background-clip | 2,090 Kb |
BEST PLACEHOLDING SERVICES | 6,317 Kb |
Gmaps.js with refresh location button | 2,293 Kb |
A Pen by Gabriel | 2,459 Kb |
Picture overlay | 2,450 Kb |
CSS3 Login | 3,115 Kb |
Cool toggle with filling effect | 2,499 Kb |
Chrome notifications test | 3,589 Kb |
Loggy.js - CSS formatted JS console logs | 2,204 Kb |
Vcard dev | 3,138 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
About Mazano | Kiti | 2,585 Kb |
SVG hamburger menu button | Elifitch | 2,602 Kb |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
Typefaces with descriptions | Megandoty | 2,944 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Coburg Banks SVG Logo | Mjtweaver | 3,875 Kb |
Client-side Email Validation | Collizo4sky | 1,538 Kb |
Portfolio Page | KaylaMT | 1,983 Kb |
AOR site logo | Thatbram | 2,527 Kb |
Another brick in the wall | Fivera | 1,955 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!