currentObject = someValue;
var src = '<%=Url.Content("~/Content/images/locations/" + currentObject + ".jpg")%>';
But since Url.Content is in ‘, the currentObject is ‘currentObject’, and not its value.
How to write the above code with currentObject’s value, not name?
you are mixing .NET(Im guessing its .NET) and javascript.
will get your src.