Probably the best way would be to write a simple method closure, which is
basically a function that returns a function. Check this out:
function myClosure(id){
return function(){
show_feed(id,'http://my.feed.com/rss.xml','5','title_only')
}
}
Then you can utilize it like this:
google.load('feeds','1',{'callback':myClosure(id)});
Essentially, this will load the Feeds API, but before it does, it will call
myClosure, which will return a function that will remember id when it comes
time for the callback to fire.
Jeremy R. Geerdes
Effective website design & development
Des Moines, IA
For more information or a project quote:
http://jgeerdes.home.mchsi.com
[email protected]
If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
On Jun 29, 2010, at 4:54 AM, MrSulo wrote:
> Hi,
>
> i have a little question.
>
> This code works great
> google.load("feeds", "1",{"callback" : "show_feed('2','http://
> my.feed.com/rss.xml','5','title_only')"});
>
> but how can i add a var?
>
> google.load("feeds", "1",{"callback" : "show_feed(''+id+'','http://
> my.feed.com/rss.xml','5','title_only')"});
>
> kind regards
> sulo (germany)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google AJAX APIs" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-ajax-search-api?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en.