<html>
<head>
<script src="jquery.js"></script>
</head>
<body>
<input id="IDValue" name="IDValue" value="<?php echo 'hello';?>" >
<textarea id="txtHint"></textarea>
<input type="button" value="Click" onClick="message()"/>
<script>
function message(){
var ID=$("#IDValue").val();
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("POST","login.php?q=" +ID,true);
xmlhttp.send();
}
</script>
</body>
</html>
答案 0 :(得分:1)
试试这个:
Private Sub CommandButton3_Click()
Dim i As Integer, n As Integer, inc As Integer, results() As Integer
Dim text As String
n = 100
inc = InputBox("Please enter increment")
ReDim results(0 To n) As Integer
For i = 1 To n Step 1
results(i) = inc + i
Next i
text = Join(results, ",")
MsgBox text
End Sub
Join()
函数将使用给定的分隔符连接单维数组并返回一个字符串。
答案 1 :(得分:1)
根据我的理解,增量是一个步长 - 连续值之间的差异。因此,代码应该是:
Private Sub CommandButton3_Click()
Dim i As Integer, n As Integer, inc As Integer, results() As Integer
Dim text As String
n = 100
inc = InputBox("Please enter increment")
ReDim results(1 To n) As Integer ' not: (0 to n)
For i = 1 To n Step inc
results(i) = i
Next i
text = Join(results, ",")
MsgBox text
End Sub