Currently, I am working with ASP.net MVC5 at a novice level.
I'm faced with the challenge of creating a div that displays an image using a JavaScript function. Here is the code snippet I have:
function showLoadingImage() {
$('#submit_EmployeeDetails').append('<div id="loading-image"><img src="~/images/ajax-loader.gif" alt="Loading..." /></div>');
}
After running the function, only the alternative "Loading..." text appears on the view instead of the actual image.
To troubleshoot this issue, I manually inserted the image into the view with the following code and it displayed perfectly:
<div>
<img src="~/images/ajax-loader.gif" />
</div>
Any insights on why the image does not appear using the showLoadingImage function would be greatly appreciated.
Thanks in advance.