I have the following code part written by my friend using jQuery in a project and I am trying to convert this to pure javascript so I can remove the jQuery file. I specially do not understand the .error() part. I have a very limited knowledge with Javascript and any help would be greatly appreciated.
function tripDestination(t, e) {
var n = Math.floor(0x10000000000000000 * Math.random()).toString(36);
n = t + "my?x=" + n, imageCell.empty(), imageCell.html("<img id='myImage' style='display: none'>");
var a = $("#myImage");
a.error(e), a.attr("src", n)
}