I have images in a jqGrid and need to reset the image to empty when resetting the row. But I am having a hard time with the syntax for getting and setting the image's path.
I have the id of the image which is unique on the page. The jqGrid is called "samples".
Please look at the code below for an idea of what I am trying to do and suggest a better syntax, since this does not work at all.
var imageField = $('#samples img[id='+imageId+']');
if ( $(imageField).src.substr(imageField.src.lastIndexOf('/')+1) != "empty.gif" )
$(imageField).src = "~/Content/images/empty.gif";