However now I have a second problem with the following code:
$.getJSON("http://localhost:59396/xxx/xxxHandler.ashx?
action=xxxjson",
function(Data) {
$.each(Data.items, function(i, item) {
alert('got here');
carousel.add(i, mycarousel_decodeEntities(item.ImageTag));
if (i == 3) return false;
});
});
in firebug I get this error (referencing the jquery-1.3.2.min.js) once
I think it hits the $.each:
G is undefined
init()()jquery-1....2.min.js (line 12)
(?)()()Carousel.aspx (line 30)
I()jquery-1....2.min.js (line 19)
F()()jquery-1....2.min.js (line 19)
[Break on this error] (function(){var l=this,g,y=l.jQuery,p=l.....each
(function(){o.dequeue(this,E)})}});
On Jun 29, 9:25 am, MorningZ <morni...@gmail.com> wrote:
> The fact it is escaped could be an issue
>
> are you doing HttpUtility.HtmlEncode in your handler for some reason?
>
> Do you know about NewtonSoft's Json.NET library that makes it a snap
> to generate JSON from .NET classes?
>
> On Jun 29, 10:07 am, expresso <dschin...@gmail.com> wrote:
>
> > I have the following setup on my page inside a function:
>
> > $.getJSON("http://localhost:59396/xxx/xxxHandler.ashx?
> > action=xxxjson",
> > function(data) {
> > alert('got here');
> > $.each(data.items, function(i, item) {
>
> > carousel.add(i, mycarousel_decodeEntities(item.ImageTag));
> > if (i == 3) return false;
> > });
> > });
>
> > I know that if I take that url and render it in the browser straight
> > up, I get this:
>
> > [{"ImageTag":"\u003cimg src=\"http://www.xxx.com/
> > cat_image/1659D.jpg\" alt=\"\"\u003e"},
> > {"ImageTag":"\u003cimg src=\"http://www.xxx.com/
> > cat_image/536.jpg\" alt=\"\"\u003e"}]
>
> > where xxx is our domain.
>
> > So not sure why it's never getting to my alert inside function(data)
No comments:
Post a Comment