function send_quick_pm() {
$.post('/privmsg', {
'username%5B%5D' : document.getElementById('quick_pm_username').value,
subject : document.getElementById('quick_pm_subject').value,
message : document.getElementById('quick_pm_message').value,
folder : 'inbox',
mode : 'post',
post : 1
}, function(r) {
alert('PM is sent!');
});
}
这就是我正在使用的代码,这是我正在使用的标记-
<form id="privatemessage" class="newmessage">
<input id="quick_pm_username" placeholder="Message To:" type="text" class="usernameinput"/>
<input id="quick_pm_subject" placeholder="Subject:" onkeypress="if (event.keyCode==13){return false}" maxlength="64" type="text" class="usernameinput"/>
<textarea id="quick_pm_message" class="noThis" placeholder="Type your message here..." >
</textarea>
</div>
<div id="bottombuttons">
<span class="button">
<button onClick="send_quick_pm();" class="submitbutton uiButton uiButtonConfirm uiButtonLarge">Submit</button>
</form>
<button class="submitbutton cancelButton uiButton uiButtonConfirm uiButtonLarge">Cancel</button>
</span>
</div>
标记可能是错误的,这是我编写代码使其看起来应该的唯一方法。
任何人都可以提出一些建议吗?