我正在尝试使用jquery自动提交表单。但由于<!doctype html>
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<form action="commant.php" method="post" name="myForm" id="myForm" target="_myFrame">
<textarea type="text" name="Comm">test submit</textarea>
<input type="submit" value="Submit" name="submit">
</form>
<script>
$("form").submit(function(){
alert('Form is submitting....');
// Or Do Something...
return true;
});
$("form").submit();
</script>
值,表单未提交。我不知道为什么,但如果我将名称值更改为提交以外的其他内容。这个using (var server = new RouterSocket("@tcp://*:80"))
{
var addresses = new HashSet<string>();
while (true)
{
var msg = server.ReceiveMultipartMessage();
var address = Encoding.UTF8.GetString(msg[0].Buffer);
var payload = Encoding.UTF8.GetString(msg[2].Buffer);
Console.WriteLine("[Server] - Client: {0} Says: {1}", address, payload);
var contains = addresses.Contains(address);
if (!contains) { addresses.Add(address); }
msg.Clear();
msg.Append(address);
msg.AppendEmptyFrame();
msg.Append("Reply for: " + address);
server.SendMultipartMessage(msg);
}
}
是必要的,提交表格。那么如何使用jquery或javascript自动提交此表单?
TryReceiveMultipartMessage