无法通过onclick命令通过javascript传递多个变量

时间:2016-08-17 05:48:11

标签: javascript function variables

我有一个PHP脚本输出此代码,但只有第一个变量会发出警报。我试图删除引号,但它只会回复第一个变量。任何帮助将不胜感激。

<html>
<head>
<script>

function add_reply(a,b,c,d){

    alert(a,b,c,d);

}


</script>

</head>

<body>

<input type="button" onclick="add_reply('reply3','3','8006549654','49')">


</body>
</html>

1 个答案:

答案 0 :(得分:0)

试试这个:

gulp.task('layout', function() {
  return gulp.src('src/**/page.html', { base: "./" })
   .pipe(wrapper({
     header: '<header></header>',
     footer: '<footer></footer>'
   }))
  .pipe(rename({basename: "test"}))
  .pipe(gulp.dest('.'));
});

function add_reply(a,b,c,d){ alert(a+" "+b+" "+c+" "+d); } 方法中只允许一个参数。连接所有变量或使用多个警报方法。在我看来,第一个过程更好。