You quoted "match", not "replace". Is this the code that caused the
error? If it is, replace the word "match" in your code with the word
"replace"; otherwise, repost with the code that generated the error.
In any event, match() takes only one argument and returns an array of
String objects, whereas replace() takes two: one RegExp and one
String, just like you have for match(), and returns the modified
String. Check your code again. The line:

$("<img/>").attr("src", item.media.m).match(/_m\.jpg/
g,'_b.jpg').appendTo("#images").fadeTo(1800, 1.0);

should read:

$("<img/>").attr("src", item.media.m).replace(/_m\.jpg/
g,'_b.jpg').appendTo("#images").fadeTo(1800, 1.0);

which should work just fine.

And I know you have jQuery in your code, but this was a JavaScript
question.

On Jun 27, 11:47 am, parrfolio <[EMAIL PROTECTED]> wrote:
> Trying to pull in flickr feed and replace the _m with _b in the url to
> print large images.
>
>                 
> $.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?
> [EMAIL PROTECTED]&lang=en-us&size=b&format=json&jsoncallback=?",
>                         function(data){
>                           $.each(data.items, function(i,item) {
>                             $("<img/>").attr("src", 
> item.media.m).match(/_m\.jpg/g,
> '_b.jpg').appendTo("#images").fadeTo(1800, 1.0);
>
>                             if ( i == 8 ) return false;
>                           });
>                                         $('#images, .content ul').innerfade({
>                                                 speed: '800',
>                                                 timeout: 5000,
>                                                 type: 'sequence'
>                                                 });
>                         });
>
> I'm having a tough time with the regular expression. I get replace is
> not a function. Anyone have any ideas on how to replace the url _m
> with _b?

Reply via email to