Code screenshot. Right side Html, left side NodeJS
我试图发布一个简单的帖子请求但是当我点击“提交”时没有任何反应。按钮。有没有办法解决这个问题,还是有另一种方法可以在我的脚本文件中的onclick侦听器中进行调用?
答案 0 :(得分:0)
您没有提交按钮。 def transform(txt: String, transformers: Seq[Transformer]): Either[Error, String] = {
type Current = Either[Error, String]
type Previous = Either[Error, String]
def foldLeftWithEarlyReturn: Tuple2[Current, Previous] = {
transformers.foldLeft[Tuple2[Current, Previous]](Right(txt) , Right(txt)){
(result, t) => result match {
case ( Right(txt) , Right(previousTxt) ) => ( t.transform(txt) , Right(txt) )
case ( Left(error) , Right(previousTxt) ) => return ( Right(previousTxt), Left(error) )
case e => e
}
}
}
if (foldLeftWithEarlyReturn._1.isLeft)
foldLeftWithEarlyReturn._2 // this means last transformation in sequence resulted in Left, so return previous
else
foldLeftWithEarlyReturn._1
}
没有默认效果,需要JavaScript才能执行任何操作。
提交按钮为type="button"
(这是默认设置)。