Jquery cycle plugin and image tag from code behind
- by Geetha
Hi All,
I am using cycle plugin to show images. I am binding the html code for image from code behind.
Problem:
Images are not getting displayed. If i hard coded the image tag it is working.
Code:
$(window).load(function() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
data: "{}",
url: "Default.aspx/GetImage",
dataType: "json",
success: function(data) {
alert(data.d);
$("#sample").html(data.d);
$('#sample').cycle({
fx: 'fade',
continuous: true,
speed: 7500,
timeout: 55000,
pause: 1,
sync: 1
});
}
});
});
Data.d will give:
<img src="Images/Frontbanner/s0.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s111.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s112.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s113.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s114.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s115.jpg" width="664" height="428" border="0" />
<img src="Images/Frontbanner/s116.jpg" width="664" height="428" border="0" />