首页 > 解决方案 > 我正在尝试为搜索按钮做一些java脚本编码,如果用户没有输入任何数据,它应该给出错误但它不起作用

问题描述

我正在尝试为搜索按钮做一些java脚本编码,如果用户没有输入任何数据,它应该给出错误但它不起作用

        if(requests.length == 0)
        {
            h4.innerHTML = "No service requests found";
            container.appendChild(h4); 
        }
        else 
        {
            h4.innerHTML = "Showing " + requests.length + " 311 Service Requests in Winnipeg 
            that contains " + neighbourhood.toUpperCase();
            container.appendChild(h4); 
            add_requests(requests); 
         }
         })

标签: javascriptapi

解决方案


推荐阅读