javascript - 输入范围滑块值应指向页面加载时 cgi 脚本值的输出
问题描述
我有一个在cgi script
其中运行bash script
并获得一个值作为输出的值。现在我希望在最初加载页面时将该值(的输出cgi
)分配给输入范围滑块的值。HTML
我该如何做到这一点?
Minimum Length<br><input type="range" id="Minlen_range" name="MinlenRange" min="0" max="100" value="8" oninput="this.form.MinlenInput.value=this.value" />
<input type="number" id="Minlen_text" name="MinlenInput" min="0" max="100" value="8" oninput="this.form.MinlenRange.value=this.value" />
下面是 CGI 脚本(testing.cgi)
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Bash as CGI" echo "</title></head><body>"
echo "<h3>Minimum Password Lenght</h3>" echo "<pre>
$(/usr/local/bin/Propertyhandler getConfiguration minlen) </pre>"
现在,在 html 页面中,默认值设置为 8,但我希望 value 属性应该指向 cgi 脚本的输出值。
解决方案
推荐阅读
- python-3.x - Scrapy中CrawlSpider的嵌套规则
- html - 在鼠标悬停时为地图添加弹出文本
- hive - hive 2.3.2 中的 kryo 库中的 stackoverflow 错误
- python - 如何使用 django 查询集获得学习者回答的所有问题?
- ios - panGesture iOS 的交互式动画
- javascript - JavaScript 输出与我的答案不同
- java - HttpMessageNotWritableException: No converter found for return value of type: class java.util.HashMap in Spring MVC
- ruby-on-rails - How to implement search with many to many relationship in Rails
- php - 在 PHP 上重新排列关联数组
- reactjs - Where to add signup button in a form in reactjs?