npm install css-loader style-loader --save-dev
webpack-dev-server --hot --host 127.0.0.1 --port 9999
<ul> <li>index</li> <li>foo</li> <li>foo2</li> </ul> <div id="cc"> </div> <script> $(function(){ $("li" ).each(function( index ) { $("div").append("<div>"+index+ ":"+$(this).text()+"</div>"); }); }); </script>
浏览器渲染成这样:
我理解就是选择器与添加元素,重叠形成的混乱
$("div").append("<div>"+index+ ":"+$(this).text()+"</div>");
明确一个ID就行了
$("#cc").append("<div>"+index+ ":"+$(this).dtext()+"</div>");
.children( [selector ] )Returns: jQuerycss
Description: Get the children of each element in the set of matched elements, optionally filtered by a selector.html
Given a jQuery object that represents a set of DOM elements, the .children()
method allows us to search through the children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .children()
method differs from .find()
in that .children()
only travels a single level down the DOM tree while .find()
can traverse down multiple levels to select descendant elements (grandchildren, etc.) as well. Note also that like most jQuery methods, .children()
does not return text nodes; to get all children including text and comment nodes, use .contents()
.vue
The .children()
method optionally accepts a selector expression of the same type that we can pass to the $()
function. If the selector is supplied, the elements will be filtered by testing whether they match it.node
.find( selector )Returns: jQueryjquery
Description: Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.webpack
Given a jQuery object that represents a set of DOM elements, the .find()
method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .find()
and .children()
methods are similar, except that the latter only travels a single level down the DOM tree.web
The first signature for the .find()
method accepts a selector expression of the same type that we can pass to the $()
function. The elements will be filtered by testing whether they match this selector.express
children() 不返回文本节点npm
.find()
和.children()
方法类似,可是children()只是查找子元素,返回的是儿子辈儿的,不是后代元素,参数可选。api
而find()方法是返回匹配元素集合中每一个元素的后代,参数必选。find()方法只在后代中遍历,不包括本身。
if($(“table:eq(“+j+”)”).find(“tbody tr:nth-child(“+i+”)”).children(“td:nth-child(2)”).text()==”直航”)
if($(“table:eq(“+j+”)”).children(“tbody”).children(“tr:nth-child(“+i+”)”).children(“td:nth-child(2)”).text()==”直航”)
download
属性 兼容旧环境若是 trim()
不存在,能够在全部代码前执行下面代码
if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); }; }
9.IE10+
半透明自动隐藏的滚动条/* IE10+ 半透明自动隐藏的滚动条 */ @-ms-viewport { width: device-width; }
CSS
自定义滚动条样式 适用于 webkit
内核浏览器
::-webkit-scrollbar 滚动条总体部分 ::-webkit-scrollbar-thumb 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决因而垂直滚动条仍是水平滚动条) ::-webkit-scrollbar-track 滚动条的轨道(里面装有Thumb) ::-webkit-scrollbar-button 滚动条的轨道的两端按钮,容许经过点击微调小方块的位置。 ::-webkit-scrollbar-track-piece 内层轨道,滚动条中间部分(除去) ::-webkit-scrollbar-corner 边角,即两个滚动条的交汇处 ::-webkit-resizer 两个滚动条的交汇处上用于经过拖动调整元素大小的小控件
You may need an appropriate loader to handle this file type.
我按着博主的原文看了看 对比一下,没有哪不对。但就是不行。最后发现 ,在webpack.config.js 里 这则项不对
{
test: /\\.css$/, loader: "style!css" },