gpt4 book ai didi

asp.net-mvc-3 - 我的 HTML 标签被篡改了

转载 作者:行者123 更新时间:2023-11-28 00:19:25 24 4
gpt4 key购买 nike

我有一个 Umbraco 5 MVC3 项目,我发现那里到处都是空白。在调查时,我发现在 firefox web 开发人员工具中“查看生成的源代码”时,我的 HTML 看起来真的很糟糕。例如,它删除了我的文档类型声明并将我的元标记和内容从头部移出。简化代码:

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="@Url.Content("~/Content/Styles/style.css")"/>
</head>
<body id="" class="default">
<div id="wrapper">
<header id="banner" class="body">
<a class="ir logo" href="/"><h1>Christian </h1></a>
<ul class="share">
<li id="facebook"><a class="ir" href="http://www.facebook.com/sharer.php?u=@Request.Url.AbsoluteUri">Facebook</a></li>
<li id="twitter"><a class="ir" href="http://twitter.com/share?text=Christian">Twitter</a></li>
</ul>
@Html.Partial("nav")
</header>
<section id="content" class="body">
@RenderBody()
</section>
</div>
<script src="@Url.Content("~/Scripts/plugins.js")"></script>
<script src="@Url.Content("~/Scripts/script.js")"></script>
</body>
</html>

输出是这样开始的

<html class="no-js" lang="en"><head></head><body id="" class="default">

最佳答案

如果您想检查服务器生成的 HTML,您应该使用查看源代码 (CTRL + U)。

生成的源代码 更像是基于 DOM 的 HTML 重构,包括例如在页面加载后在客户端使用 javascript 创建的节点。

关于asp.net-mvc-3 - 我的 HTML 标签被篡改了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10016108/

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