I'm trying to create a script that check to see whether a logo exists or not. If it doesn't, I want to use innerHTML
to output the firm name instead.
$.get(firmlogo)
.done(function() {
document.getElementById('firmlogo').innerHTML = "<img src="+logooffirm+">";
}).fail(function() {
document.getElementById('firmlogo').innerHTML = "<h2>"+nameoffirm+"</h2>";
})
It displays the text now, even if the logo is there. The error I get is:
Failed to load resource: the server responded with a status of 404 (Not Found) http://www.example.com/[object%20HTMLDivElement] Failed to load resource: the server responded with a status of 404 (Not Found)
Any ideas on what I'm doing wrong?