Setting image markup to a div is not loading the image
صفحه اصلي

Setting image markup to a div is not loading the image

I am using Visual studio 2008 in Windows 7. After an ajax call, I am building an image markup dynamically and setting it to a div like this.

var imageLocation="<%= Url.Action("Show", "Images", new { Id = Model.LoginUser.UserId })%>"; var markup = '<img  class="profile-Image" src="' + imageLocation + '"/>';  $('.divImgdisplay').html(markup); 

The variable imageLocation is pointing to proper URL. When this markup is set to div element, it is not loading the image in IE 8 and in IE8 compatible mode. But firefox it is loading the image. After debugging we found that server is not receiving the request for image from the IE. Can you please help us.

is there a way to programatically set a filter in jquery jqgrid?

1: MVC utilising WCF
Maybe it helps, to set the imageLocation like this:. Which strategy to choose for building web based business application
$('.divImgdisplay img').attr('src', imageLocation); 
ASP.NET MVC output cache with dynamic fragmentRedirect site from to in mvc


Jquery thickbox to work with Url.Action link in mvc
What if you did it like this:. Structuring several mostly-static pages in ASP.NET MVC
$('<img class="profile-Image" />').attr('src', imageLocation).appendTo( $('.divImgdisplay') ); 
or. Function to display a DateTime string or an empty string
$('.divImgdisplay').append( $('<img class="profile-Image" />').attr('src', imageLocation) ); 

52 out of 100 based on 67 user ratings 662 reviews