ajax返回的内容,居然自动添加了pre标签,解决方法是修改一般处理程序的返回类型,遇到类似情况的可以参考下
ajax返回,自动添加pre标签
ajax返回的内容,居然自动添加了
标签<p>在FF,ie,谷歌浏览器中,每个返回的都不一样:ff小写,ie大写,谷歌加style</p><p>查了一下,原来是返回的类型不对。</p><p>最终解决结果,修改一般处理程序的返回类型</p><p>把</p><p>context.Response.ContentType = "text/plain";</p><p>修改为</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1875">
<img src="https://img.php.cn/upload/ai_manual/000/969/633/68b6c50ec09de372.png" alt="Upscale">
</a>
<div class="aritcle_card_info">
<a href="/ai/1875">Upscale</a>
<p>AI图片放大工具</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="Upscale">
<span>85</span>
</div>
</div>
<a href="/ai/1875" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="Upscale">
</a>
</div>
<p>context.Response.ContentType = "text/html";</p><p>上面是我整理给大家的,希望今后会对大家有帮助。</p><p>相关文章:</p><p><a href="http://www.php.cn/js-tutorial-397992.html" target="_blank">详解Ajax和form+iframe 实现文件上传的方法</a><br></p><p><a href="http://www.php.cn/js-tutorial-397990.html" target="_blank">浅析巧用Ajax的beforeSend提高用户体验</a><br></p><p><a href="http://www.php.cn/js-tutorial-397988.html" target="_blank">ajax传送参数含有特殊字符的快速解决方法</a><br></p><p class="art_xg"></p><p></p><p class="clearfix"><span class="jbTestPos"></span></p>以上就是ajax 返回值自动添加pre标签的解决方法的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号