gpt4 book ai didi

javascript - 根据服务器的响应操作 DOM

转载 作者:行者123 更新时间:2023-11-30 16:56:28 26 4
gpt4 key购买 nike

我有一个 HTML 页面,它使用 JQuery 的 POST ($.post().done()) 发送查询并从服务器获取响应

<!doctype html>
<html>
<head>
<script src="jquery-1.11.2.min.js"></script>
</head>
<body>

<center>
<div>
<h3>Web Service Search Engine </h3>
<input type="textbox" name="UserQuery" id="UserQuery" size="70"></br></br>
<button type="button" onclick="search()">Search</button>
</div>
</center>
<div id="Results">
</div>
<script>
function search()
{
$.post("Check.php", {
UserQuery: $("#UserQuery").val()

})
.done(function(data) {

})
}
</script>

</body>
</html>

Check.php 的响应是一些已经格式化的链接

<a href="Crawled WSDL Documents/21272_United_States_shortlynx.wsdl">Crawled WSDL Documents/21272_United_States_shortlynx.wsdl</a><br/>
<a href="Crawled WSDL Documents/16932_United_States_dailycomicsservice.wsdl">Crawled WSDL Documents/16932_United_States_dailycomicsservice.wsdl</a><br/>
<a href="Crawled WSDL Documents/15465_United_States_measurementconversions.wsdl">Crawled WSDL Documents/15465_United_States_measurementconversions.wsdl</a><br/>
<a href="Crawled WSDL Documents/14242_United_States_converter.wsdl">Crawled WSDL Documents/14242_United_States_converter.wsdl</a><br/>
<a href="Crawled WSDL Documents/17606_Spain_conversor.wsdl">Crawled WSDL Documents/17606_Spain_conversor.wsdl</a><br/>

如何将此响应放入 id = Results 的 DIV 标记中??

最佳答案

我不是想欺骗评论员。我只是给它作为答案

$("#Results").html(data);

感谢 Brijesh Bhatt

关于javascript - 根据服务器的响应操作 DOM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29642146/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com