boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - javascript function-ask for help
相关主题
Any difference between class and typename identifier?
operator overloading (C++)
Default function template arguments
ajax小问题
急问:问一段code是不是好的Practice,是什么意思?
How to run Message Passing Interface C file?
python question
i +++ j
how to find the smallest matching pattern in Lex
[合集] Message Queue的问题
相关话题的讨论汇总
话题: requestid话题: function话题: category话题: request话题: items
进入Programming版参与讨论
1 (共1页)
n*****y
发帖数: 552
1
Let's say I have category as 'a', how can get items from the function below?
This is a javascript function. Really feel lost how to use the parameter
success.
thanks a million
getItemsInCategory(category, success, failure)
Description
Asynchronously retrieves an array of all items which belong to the specified
category.
Parameters
category – [required] [string] The category to query. Currently, the only
categories which contain items are “a”, “b”, “c”.
success – [optional] [function (requestId, itemArray)] If supplied, will be
called if the request successfully completes. requestId will be the id of
the request which has completed. itemArray will be an array of item objects.
Each entry in the array will have these properties:
•id – Unique identifier for this item
•name – short name of this item that is meaningful to the user
failure – [optional] [function (requestId, error)] If supplied, will be
called if the request fails. requestId will be the id of the request which
has completed. error will be a string detailing the error.
Return Value
The method returns a requestId which uniquely identifies this request.
X****r
发帖数: 3557
2
getItemsInCategory('a', function(id, items) {
for (var i=0, l=items.length; i < l; ++i) {
console.log(items[i]);
}
});

below?
specified

【在 n*****y 的大作中提到】
: Let's say I have category as 'a', how can get items from the function below?
: This is a javascript function. Really feel lost how to use the parameter
: success.
: thanks a million
: getItemsInCategory(category, success, failure)
: Description
: Asynchronously retrieves an array of all items which belong to the specified
: category.
: Parameters
: category – [required] [string] The category to query. Currently, the only

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] Message Queue的问题
app store 上载 (转载)
【请教】mpicc 和 mpiCC编译问题
弱问一个ifdef 和ifndef
请教一个C的问题
template 疑问
程序怎么不认识class, namespace等identifier呀?
Using unordered_map in Visual Studio
C++ Q03:
C++ Q07: unnamed namespace
相关话题的讨论汇总
话题: requestid话题: function话题: category话题: request话题: items