【发布时间】:2013-06-19 12:44:24
【问题描述】:
有什么方法可以将arguments 传递给jquery/javascript,如下所示
function showContentDiv(args ......){
//do some thing with looping args
}
和类似的用法
showContent("","","",""); //should change the parma count each time
避免在 jquery 中准备数组并传递的原因是 我有如下链接
<a onclick="javaScript:showContent("val1","val2","val3")">
<a onclick="javaScript:showContent("val1","val2")">
【问题讨论】:
-
或者它可能是 Is it possible to send a variable number of arguments to a JavaScript function? 的副本。不知道你问的是如何创建可变参数函数还是如何调用。
标签: javascript jquery function web-applications arguments