我希望有
我不知道如何将所有这些结合在一起.
<form action="upgage.php">
revision <input type="text" name="revision" value="" /><br />
<input type="submit" value="update code base" />
<input type="submit" value="get current revision" />
</form>
Run Code Online (Sandbox Code Playgroud)
我想只使用javascript而不是jQuery
<form action="upgage.php">
<input type="submit" id="revision"/> <input type="text" id="passedValue" value="" /><br />
<input type="submit" value="update" />
</form>
Run Code Online (Sandbox Code Playgroud)
现在在jQuery中:
$("#revision").click(function(event) {
event.preventDefault();
$.post("/my/url/", function(data) {
$("#passedValue").val(data);
});
});
Run Code Online (Sandbox Code Playgroud)
希望我理解你:P
<script>
document.getElementById('getValueButton').onclick = function() {
document.getElementById('revisionTextField').value = getRevisionViaAjax();
}
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
44836 次 |
| 最近记录: |