Jquery cycle plugin and image tag from code behind

Posted by Geetha on Stack Overflow See other posts from Stack Overflow or by Geetha
Published on 2010-04-07T04:03:36Z Indexed on 2010/04/07 4:13 UTC
Read the original article Hit count: 225

Filed under:
|
|

Hi All,

I am using cycle plugin to show images. I am binding the html code for image from code behind.

Problem:

  1. 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" />

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about cycle