我按输入时尝试搜索,此处我使用 livesearch.js 进行搜索,但此js始终在输入时搜索。我想在按下输入时进行搜索。所以我尝试过改变,但仍然没有工作。
框架js
<script type="text/javascript" src="framework/liveSearch/livesearch.js"></script>
HTML
<input type="text" id="livesearch" class="livesearch" style="margin-top:0;"/>
<div class="searchresult" id="liveRequestResults"></div>
<iframe id="mainResult" src='log-list.php'></iframe>
的Javascript
<script>
$('#livesearch').keydown(function(e) {
if(e.keyCode == 13) // I tried this code, first enter worked, after that back to search when typing
{
liveReqInit('livesearch','liveRequestResults','log-ls.php','','mainResult'); //this search work when typing
}
})
</script>
答案 0 :(得分:0)
根据我的理解,您需要一个普通的搜索框。这将把值提交给你的后端(我假设是log-ls.php)。
from exchangelib import DELEGATE, Account, Credentials, EWSDateTime
creds = Credentials(
username='xxx.test.com\test',
password='123456')
account = Account(
primary_smtp_address='test@test.com',
credentials=creds,
autodiscover=True,
access_type=DELEGATE)
# Print first 100 inbox messages in reverse order
for item in account.inbox.all().order_by('-datetime_received')[:100]:
# print(item.subject, item.body, item.attachments)
print(item.subject)