Replace a not existing img

Developer
Size
2,026 Kb
Views
34,408

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 Previews

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" &rarr; ".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");
});
Replace a not existing img - Script Codes
Replace a not existing img - Script Codes
Home Page Home
Developer Gabriel
Username gab
Uploaded July 18, 2022
Rating 3
Size 2,026 Kb
Views 34,408
Do you need developer help for Replace a not existing img?

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!

Gabriel (gab) Script Codes
Create amazing web content with AI!

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!