there is nothing wrong with the mycarousel_decodeEntities function so
either your passing something it is not expecting, some part of jquery
didn't load right or you have a syntax problem somewhere else

Mean Mike

On Jun 29, 1:49 pm, expresso <dschin...@gmail.com> wrote:
> I borrowed this function 
> fromhttp://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_feed.html
>
> function mycarousel_decodeEntities(s) {
>     return s.replace(/&amp;/g, "&")
>             .replace(/&quot;/g, '"')
>             .replace(/&#039;/g, "'")
>             .replace(/&lt;/g, "<")
>             .replace(/&gt;/g, ">");
>
> };
>
> and I'm trying to use it in my code here:
>
> function mycarousel_itemLoadCallback(carousel, state) {
>
>     $.getJSON("http://localhost:59396/xxx/xxxHandler.ashx?
> action=cjson",
>         function(data) {
>             $.each(data, function(i, item) {
>                 carousel.add(i, mycarousel_decodeEntities(item));
>                 if (i == 3) return false;
>             });
>         });
>
> };
>
> for some reason I get an error in firebug saying this:
>
> s.replace is not a function
> [Break on this error] return s.replace(/&amp;/g, "&")
>
> I know I've used this very same code before and the only difference
> was that I changed some JSON that is returned but it's valid json.

Reply via email to