问题描述
我检查,看看有什么要求看喜欢从服务器下载JavaScript文件时发现的差异。我只是想看到链接在HTML是什么样子,但是当我在检查检查,我无法找到任何JavaScript的任何引用。当我检查源,他们肯定有。
您可以在这里看到的例子:
我似乎无法找出原因。
这是在Firebug的检查:
这里,它从源头上观看的时候:
有也似乎在两者之间消失一些元素的属性
有人能解释为什么吗?
编辑:
下面是从源代码完整的标记:
<!DOCTYPE HTML>
< HTML LANG =EN数据框架=angularjs>
< HEAD>
<间的charset =UTF-8>
< META HTTP-EQUIV =X-UA-Compatible的内容=IE =边缘>
<标题> AngularJS•TodoMVC< /标题>
<链接rel =stylesheet属性HREF =bower_components / todomvc常见/ base.css>
<风格> [NG-披风] {显示:无; }< /风格>
< /头>
<机身NG-应用=todomvc>
< NG画面/> <脚本类型=文/ NG-模板ID =todomvc-的index.html>
<节ID =todoappNG控制器=TodoCtrl>
<标题ID =头>
< H1>&待办事项LT; / H1>
<表ID =待办事项形式的NG提交=addTodo()>
<输入ID =新TODO占位=需要采取哪些措施? NG-模式=newTodo自动对焦>
< /表及GT;
< /头>
<节ID =main的NG-秀=todos.lengthNG-斗篷>
<输入ID =切换所有类型=复选框NG模型=allCheckedNG点击=markAll(allChecked)>
<标签=切换所有>标记全部为已完成< /标签>
< UL ID =待办事项列表>
<李NG重复=待办事项待办事项中|过滤器:statusFilter轨道由$指数NG-CLASS ={完成:todo.completed,编辑:待办事项== editedTodo}>
< DIV CLASS =查看>
<输入类=切换式=复选框NG模型=todo.completed>
<标签NG-DBLCLICK =editTodo(待)> {{todo.title}}< /标签>
<按钮类=消灭NG点击=removeTodo(待)>< /按钮>
< / DIV>
<形式NG提交=doneEditing(待)>
<输入类=编辑NG-修剪=false的NG-模式=todo.title待办事项逃逸=revertEditing(待)NG模糊=doneEditing(待)待办事项焦=待办事项== editedTodo>
< /表及GT;
< /李>
< / UL>
< /节>
<页脚ID =页脚NG-秀=todos.lengthNG-斗篷>
<跨度ID =待办事项数><强> {{remainingCount}}< / STRONG>
< NG-复数计数=remainingCount时={之一:项左',其他:'项目左'}>< / NG-复数>
< / SPAN>
< UL ID =过滤器>
<立GT;
<一纳克级={选择:状态==''}的href =#/>所有< / A>
< /李>
<立GT;
<一纳克级={选择:状态=='积极'}的href =#/主动>活动< / A>
< /李>
<立GT;
<一纳克级={选择:状态=='完成'}的href =#/完成>完成< / A>
< /李>
< / UL>
<按钮ID =明确完成的NG点击=clearCompletedTodos()NG-秀=completedCount>清除已完成({{completedCount}})LT; /按钮>
< /页脚>
< /节>
<页脚ID =信息>
< P>双击编辑待办事项< / P>
< P>积分:
&所述; A HREF =http://twitter.com/cburgdorf>克里斯托夫布格多夫&下; /一>中
&所述; A HREF =http://ericbidelman.com>埃里克Bidelman&下; /一>中
< A HREF =http://jacobmumm.com>雅各玛姆< / A>和
&所述; A HREF =http://igorminar.com>伊戈尔高塔&下; / A>
&所述; / P>
&所述p为H.; A HREF =http://todomvc.com>&所述部分TodoMVC&下; / A>&下; / P>
< /页脚>
< / SCRIPT>
<脚本SRC =bower_components / todomvc常见/ base.js>< / SCRIPT>
&所述; SCRIPT SRC =bower_components /角度/ angular.js>&下; /脚本>
<脚本SRC =bower_components /角路由/角route.js>< / SCRIPT>
<脚本SRC =JS / app.js>< / SCRIPT>
<脚本SRC =JS /控制器/ todoCtrl.js>< / SCRIPT>
<脚本SRC =JS /服务/ todoStorage.js>< / SCRIPT>
<脚本SRC =JS /指令/ todoFocus.js>< / SCRIPT>
<脚本SRC =JS /指令/ todoEscape.js>< / SCRIPT>
< /身体GT;
< / HTML>
和这里的标记看起来像什么检查:
<!DOCTYPE HTML>
< HTML LANG =EN数据框架=angularjs>
< HEAD>
<风格类型=文/ CSS>
@charsetUTF-8;
[NG \\:披风],[NG-披风],[数据-NG-披风],[X-NG-披风] ,. NG-斗篷,.X-NG-斗篷,.ng隐藏{
!显示:无重要;
} NG \\:表格{
显示:块;
}
< /风格>
<间的charset =UTF-8>
<间内容=IE =边缘HTTP的当量=X-UA-Compatible的>
<标题>
AngularJS•TodoMVC
< /标题>
<链接HREF =bower_components / todomvc常见/ base.css的rel =stylesheet属性>
<风格>
[NG-披风] {
显示:无;
}
< /风格>
< /头>
<车身类=学习吧NG-范围NG-应用=todomvc>
<一边类=学习>
<报头GT;
< H3>
AngularJS
< / H3 GT&;
<跨度类=源链接>
<&H5 GT;
架构示例
< / H5>
&所述; A HREF =https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/angularjs>
资源
&所述; / A>
<&H5 GT;
依赖实例
< / H5>
<一类=试玩链接的href =http://todomvc.com/labs/dependency-examples/angularjs_require>
演示
&所述; / A>
,
<一href=\"https://github.com/tastejs/todomvc/tree/gh-pages/labs/dependency-examples/angularjs_require\">
资源
&所述; / A>
<&H5 GT;
AngularJS优化
< / H5>
<一类=试玩链接的href =http://todomvc.com/architecture-examples/angularjs-perf>
演示
&所述; / A>
,
&所述; A HREF =https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/angularjs-perf>
资源
&所述; / A>
<&H5 GT;
打字稿及放大器; AngularJS
< / H5>
<一类=试玩链接的href =http://todomvc.com/labs/architecture-examples/typescript-angular>
演示
&所述; / A>
,
<一href=\"https://github.com/tastejs/todomvc/tree/gh-pages/labs/architecture-examples/typescript-angular\">
资源
&所述; / A>
< / SPAN>
< /头>
<小时>
<块引用类=报价讲话泡沫>
&所述p为H.;
HTML是伟大的声明静态文档,但是当我们试图用它来声明在Web应用动态视图它上不去。 AngularJS让你为你的应用程序扩展HTML的词汇。由此产生的环境显得格外前pressive,可读性和快速发展。
&所述; / P>
<页脚GT&;
&所述; A HREF =http://angularjs.org>
AngularJS
&所述; / A>
< /页脚>
< / BLOCKQUOTE>
<小时>
< H4>
官方资源
< / H4>
< UL>
<立GT;
&所述; A HREF =http://docs.angularjs.org/tutorial>
教程
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://docs.angularjs.org/api>
API参考
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://docs.angularjs.org/guide>
开发人员指南
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://builtwith.angularjs.org>
与AngularJS构建的应用程序
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://blog.angularjs.org>
博客
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://docs.angularjs.org/misc/faq>
常问问题
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://www.youtube.com/angularjs>
AngularJS聚会
&所述; / A>
< /李>
< / UL>
< H4>
文章和指南
< / H4>
< UL>
<立GT;
&所述; A HREF =HTTP://www.$c$cschool.com/$c$c_tv/angularjs-part-1>
code学校AngularJS课程
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://net.tutsplus.com/tutorials/javascript-ajax/5-awesome-angularjs-features>
5真棒AngularJS特点
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://briantford.com/blog/angular-yeoman.html>
使用约曼与AngularJS
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://stephenplusplus.github.io/meangular>
ME&安培; ngular - 介绍MVW
&所述; / A>
< /李>
< / UL>
< H4>
社区
< / H4>
< UL>
<立GT;
&所述; A HREF =http://www.youtube.com/playlist?list=PL1w1q3fL4pmgqpzb-XhG7Clgi67d_OHXz>
演练和教程YouTube上
&所述; / A>
< /李>
<立GT;
&所述; A HREF =https://groups.google.com/forum/?fromgroups#!forum/angular>
谷歌网上论坛邮寄名单
&所述; / A>
< /李>
<立GT;
&所述; A HREF =http://stackoverflow.com/questions/tagged/angularjs>
Stack Overflow上angularjs
&所述; / A>
< /李>
<立GT;
&所述; A HREF =https://twitter.com/angularjs>
在Twitter上AngularJS
&所述; / A>
< /李>
<立GT;
&所述; A HREF =https://plus.google.com/+AngularJS/posts>
在谷歌+ AngularjS
&所述; / A>
< /李>
< / UL>
<页脚GT&;
<小时>
<环监GT;
如果您有其他有用的链接分享,或发现任何以上不再起作用的链接,请
&所述; A HREF =https://github.com/tastejs/todomvc/issues>
让我们知道
&所述; / A>
。
< / EM>
< /页脚>
< /一旁>
< NG-view类=NG-范围>
<节ID =todoapp级=NG-范围NG控制器=TodoCtrl>
<标题ID =头>
< H1>
待办事项
< / H1>
<表ID =待办事项形式级=NG-原始NG-有效的NG提交=addTodo()>
<输入ID =新待办事项级=NG-原始NG-有效自动对焦=NG-模式=newTodo占位符=需要采取哪些措施&GT?;
< /表及GT;
< /头>
<节ID =主级=NG隐藏NG-秀=todos.length>
<输入ID =切换所有级=NG-原始NG-有效类型=复选框NG点击=markAll(allChecked)NG模型=allChecked>
<标签=切换所有>
标记全部为已完成
< /标签>
< UL ID =待办事项列表> < / UL>
< /节>
<页脚ID =页脚级=NG隐藏NG-秀=todos.length>
<跨度ID =待办事项数>
<强类=NG结合>
0
< / STRONG>
{:项左',其他:一个人留下的物品'};&LT时= NG-复数数=remainingCount>
剩下的项目
< / NG-复数>
< / SPAN>
< UL ID =过滤器>
<立GT;
<一类=选择的href =#/NG-CLASS ={选择:状态==''}>
所有
&所述; / A>
< /李>
<立GT;
< A HREF =#/主动NG-CLASS ={选择:状态=='积极'}>
活性
&所述; / A>
< /李>
<立GT;
< A HREF =#/完成NG-CLASS ={选择:已完成状态==}>
完成
&所述; / A>
< /李>
< / UL>
<按钮ID =明确完成的阶级=NG结合NG隐藏NG-秀=completedCountNG点击=clearCompletedTodos()>
清除已完成(0)
< /按钮>
< /页脚>
< /节>
<页脚ID =信息级=NG-范围>
&所述p为H.;
双击编辑待办事项
&所述; / P>
&所述p为H.;
积分:
&所述; A HREF =http://twitter.com/cburgdorf>
克里斯托夫·布格多夫
&所述; / A>
,
&所述; A HREF =http://ericbidelman.com>
埃里克Bidelman
&所述; / A>
,
&所述; A HREF =http://jacobmumm.com>
雅各布·玛姆
&所述; / A>
和
&所述; A HREF =http://igorminar.com>
伊戈尔高塔
&所述; / A>
&所述; / P>
&所述p为H.;
部分
&所述; A HREF =http://todomvc.com>
TodoMVC
&所述; / A>
&所述; / P>
< /页脚>
< / NG-视图>
< /身体GT;
< / HTML>
检查=的DOM当前状态(可通过脚本来modfied),源$ C $ C =原始数据由服务器发送。
某些元素,如剧本
S中的,其中用于存储模板或其他数据,通常是由DOM的库中移除了他们的内容被读取,保持DOM干净后。
这就是为什么他们不检查员出现。
I discovered the difference when checking to see what the requests looked like to download the JavaScript files from the server. I just wanted to see what the link looked like in the HTML, but when I checked in the inspector, I couldn't find any references to any JavaScript. When I checked the source, they were certainly there.
You can see the example here: http://todomvc.com/architecture-examples/angularjs/#/
I can't seem to figure out why.
Here it is in Firebug's inspector:
And here it is when viewing it from the source:
There are also some element attributes that seem to disappear between the two.
Can someone explain why?
Edit:
Here's the complete markup from source:
<!doctype html>
<html lang="en" data-framework="angularjs">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AngularJS • TodoMVC</title>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css">
<style>[ng-cloak] { display: none; }</style>
</head>
<body ng-app="todomvc">
<ng-view />
<script type="text/ng-template" id="todomvc-index.html">
<section id="todoapp" ng-controller="TodoCtrl">
<header id="header">
<h1>todos</h1>
<form id="todo-form" ng-submit="addTodo()">
<input id="new-todo" placeholder="What needs to be done?" ng-model="newTodo" autofocus>
</form>
</header>
<section id="main" ng-show="todos.length" ng-cloak>
<input id="toggle-all" type="checkbox" ng-model="allChecked" ng-click="markAll(allChecked)">
<label for="toggle-all">Mark all as complete</label>
<ul id="todo-list">
<li ng-repeat="todo in todos | filter:statusFilter track by $index" ng-class="{completed: todo.completed, editing: todo == editedTodo}">
<div class="view">
<input class="toggle" type="checkbox" ng-model="todo.completed">
<label ng-dblclick="editTodo(todo)">{{todo.title}}</label>
<button class="destroy" ng-click="removeTodo(todo)"></button>
</div>
<form ng-submit="doneEditing(todo)">
<input class="edit" ng-trim="false" ng-model="todo.title" todo-escape="revertEditing(todo)" ng-blur="doneEditing(todo)" todo-focus="todo == editedTodo">
</form>
</li>
</ul>
</section>
<footer id="footer" ng-show="todos.length" ng-cloak>
<span id="todo-count"><strong>{{remainingCount}}</strong>
<ng-pluralize count="remainingCount" when="{ one: 'item left', other: 'items left' }"></ng-pluralize>
</span>
<ul id="filters">
<li>
<a ng-class="{selected: status == ''} " href="#/">All</a>
</li>
<li>
<a ng-class="{selected: status == 'active'}" href="#/active">Active</a>
</li>
<li>
<a ng-class="{selected: status == 'completed'}" href="#/completed">Completed</a>
</li>
</ul>
<button id="clear-completed" ng-click="clearCompletedTodos()" ng-show="completedCount">Clear completed ({{completedCount}})</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
<p>Credits:
<a href="http://twitter.com/cburgdorf">Christoph Burgdorf</a>,
<a href="http://ericbidelman.com">Eric Bidelman</a>,
<a href="http://jacobmumm.com">Jacob Mumm</a> and
<a href="http://igorminar.com">Igor Minar</a>
</p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
</script>
<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers/todoCtrl.js"></script>
<script src="js/services/todoStorage.js"></script>
<script src="js/directives/todoFocus.js"></script>
<script src="js/directives/todoEscape.js"></script>
</body>
</html>
And here's what the markup looks like in the inspector:
<!DOCTYPE html>
<html lang="en" data-framework="angularjs">
<head>
<style type="text/css">
@charset "UTF-8";
[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{
display:none !important;
}ng\:form{
display:block;
}
</style>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<title>
AngularJS • TodoMVC
</title>
<link href="bower_components/todomvc-common/base.css" rel="stylesheet">
<style>
[ng-cloak] {
display: none;
}
</style>
</head>
<body class="learn-bar ng-scope" ng-app="todomvc">
<aside class="learn">
<header>
<h3>
AngularJS
</h3>
<span class="source-links">
<h5>
Architecture Example
</h5>
<a href="https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/angularjs">
Source
</a>
<h5>
Dependency Example
</h5>
<a class="demo-link" href="http://todomvc.com/labs/dependency-examples/angularjs_require">
Demo
</a>
,
<a href="https://github.com/tastejs/todomvc/tree/gh-pages/labs/dependency-examples/angularjs_require">
Source
</a>
<h5>
AngularJS Optimized
</h5>
<a class="demo-link" href="http://todomvc.com/architecture-examples/angularjs-perf">
Demo
</a>
,
<a href="https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/angularjs-perf">
Source
</a>
<h5>
TypeScript & AngularJS
</h5>
<a class="demo-link" href="http://todomvc.com/labs/architecture-examples/typescript-angular">
Demo
</a>
,
<a href="https://github.com/tastejs/todomvc/tree/gh-pages/labs/architecture-examples/typescript-angular">
Source
</a>
</span>
</header>
<hr>
<blockquote class="quote speech-bubble">
<p>
HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.
</p>
<footer>
<a href="http://angularjs.org">
AngularJS
</a>
</footer>
</blockquote>
<hr>
<h4>
Official Resources
</h4>
<ul>
<li>
<a href="http://docs.angularjs.org/tutorial">
Tutorial
</a>
</li>
<li>
<a href="http://docs.angularjs.org/api">
API Reference
</a>
</li>
<li>
<a href="http://docs.angularjs.org/guide">
Developer Guide
</a>
</li>
<li>
<a href="http://builtwith.angularjs.org">
Applications built with AngularJS
</a>
</li>
<li>
<a href="http://blog.angularjs.org">
Blog
</a>
</li>
<li>
<a href="http://docs.angularjs.org/misc/faq">
FAQ
</a>
</li>
<li>
<a href="http://www.youtube.com/angularjs">
AngularJS Meetups
</a>
</li>
</ul>
<h4>
Articles and Guides
</h4>
<ul>
<li>
<a href="http://www.codeschool.com/code_tv/angularjs-part-1">
Code School AngularJS course
</a>
</li>
<li>
<a href="http://net.tutsplus.com/tutorials/javascript-ajax/5-awesome-angularjs-features">
5 Awesome AngularJS Features
</a>
</li>
<li>
<a href="http://briantford.com/blog/angular-yeoman.html">
Using Yeoman with AngularJS
</a>
</li>
<li>
<a href="http://stephenplusplus.github.io/meangular">
me&ngular - an introduction to MVW
</a>
</li>
</ul>
<h4>
Community
</h4>
<ul>
<li>
<a href="http://www.youtube.com/playlist?list=PL1w1q3fL4pmgqpzb-XhG7Clgi67d_OHXz">
Walkthroughs and Tutorials on YouTube
</a>
</li>
<li>
<a href="https://groups.google.com/forum/?fromgroups#!forum/angular">
Google Groups mailing list
</a>
</li>
<li>
<a href="http://stackoverflow.com/questions/tagged/angularjs">
angularjs on Stack Overflow
</a>
</li>
<li>
<a href="https://twitter.com/angularjs">
AngularJS on Twitter
</a>
</li>
<li>
<a href="https://plus.google.com/+AngularJS/posts">
AngularjS on Google +
</a>
</li>
</ul>
<footer>
<hr>
<em>
If you have other helpful links to share, or find any of the links above no longer work, please
<a href="https://github.com/tastejs/todomvc/issues">
let us know
</a>
.
</em>
</footer>
</aside>
<ng-view class="ng-scope">
<section id="todoapp" class="ng-scope" ng-controller="TodoCtrl">
<header id="header">
<h1>
todos
</h1>
<form id="todo-form" class="ng-pristine ng-valid" ng-submit="addTodo()">
<input id="new-todo" class="ng-pristine ng-valid" autofocus="" ng-model="newTodo" placeholder="What needs to be done?">
</form>
</header>
<section id="main" class="ng-hide" ng-show="todos.length">
<input id="toggle-all" class="ng-pristine ng-valid" type="checkbox" ng-click="markAll(allChecked)" ng-model="allChecked">
<label for="toggle-all">
Mark all as complete
</label>
<ul id="todo-list">
</ul>
</section>
<footer id="footer" class="ng-hide" ng-show="todos.length">
<span id="todo-count">
<strong class="ng-binding">
0
</strong>
<ng-pluralize when="{ one: 'item left', other: 'items left' }" count="remainingCount">
items left
</ng-pluralize>
</span>
<ul id="filters">
<li>
<a class="selected" href="#/" ng-class="{selected: status == ''} ">
All
</a>
</li>
<li>
<a href="#/active" ng-class="{selected: status == 'active'}">
Active
</a>
</li>
<li>
<a href="#/completed" ng-class="{selected: status == 'completed'}">
Completed
</a>
</li>
</ul>
<button id="clear-completed" class="ng-binding ng-hide" ng-show="completedCount" ng-click="clearCompletedTodos()">
Clear completed (0)
</button>
</footer>
</section>
<footer id="info" class="ng-scope">
<p>
Double-click to edit a todo
</p>
<p>
Credits:
<a href="http://twitter.com/cburgdorf">
Christoph Burgdorf
</a>
,
<a href="http://ericbidelman.com">
Eric Bidelman
</a>
,
<a href="http://jacobmumm.com">
Jacob Mumm
</a>
and
<a href="http://igorminar.com">
Igor Minar
</a>
</p>
<p>
Part of
<a href="http://todomvc.com">
TodoMVC
</a>
</p>
</footer>
</ng-view>
</body>
</html>
Inspector = current state of the dom (May be modfied by scripts), source code = original data send by server.
Certain elements like script
s that where used to store templates or other data , are often removed from dom by the libraries after their content was read to keep the dom clean.
That's why they don't appear in the inspector.
这篇关于为什么&LT;脚本&GT;标签没有出现在Firefox中的检查员对AngularJS的todomvc例子,但都为源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!