首页 > 解决方案 > 烧瓶上的“错误请求”错误

问题描述

我认为我的问题是烧瓶找不到我的 java 脚本的键和值。那么,我该如何解决呢?这是我的蟒蛇:

def ledStudy_handler():
    if request.form['study'] == "on":
            GPIO.output(11, GPIO.HIGH)
            print("lights on")
    elif request.form['study'] == "off":
            GPIO.output(11, GPIO.LOW)
            print("lights off")
    return render_template("home.html")

这是我的js:

      function ledStudy() {
        var checkStudy = document.getElementById("checkStudy");
        if (checkStudy.checked == true){
          var checkStudy.study = "on";
        } 
        else {
          var checkStudy.study = "off";
        }
      }

标签: javascriptpythonflask

解决方案


推荐阅读