console.log('one');
setTimeout(function() {
console.log('two');
}, 0);
console.log('three');
Run Code Online (Sandbox Code Playgroud)
输出是:'一''三''二'
现场背后会发生什么?为什么代码产生这个输出?
我为我的后端使用nodejs&expressjs,为我的前端使用Angular.在我的网站中使用Angular翻译时,控制台会显示以下消息:
Error: JSON Parse error: Property name must be a string literal
parse@[native code]
fromJson@http://localhost:3000/angular/angular.js:1321:19
defaultHttpResponseTransform@http://localhost:3000/angular/angular.js:10393:24
http://localhost:3000/angular/angular.js:10484:14
forEach@http://localhost:3000/angular/angular.js:322:24
transformData@http://localhost:3000/angular/angular.js:10483:10
transformResponse@http://localhost:3000/angular/angular.js:11278:34
processQueue@http://localhost:3000/angular/angular.js:15961:30
http://localhost:3000/angular/angular.js:15977:39
$eval@http://localhost:3000/angular/angular.js:17229:28
$digest@http://localhost:3000/angular/angular.js:17045:36
$apply@http://localhost:3000/angular/angular.js:17337:31
done@http://localhost:3000/angular/angular.js:11572:53
completeRequest@http://localhost:3000/angular/angular.js:11778:15
requestLoaded@http://localhost:3000/angular/angular.js:11711:24
Run Code Online (Sandbox Code Playgroud)
我确信引用了JSON文件中的所有属性.
这是语言环境文件:
{
"directives.language-select.Language": "Select Language",
"views.video-modal.Download": "Download",
"views.video-modal.Visit": "Visit",
"views.video-modal.Copy": "Copy",
"views.video-modal.Close": "Close",
}
Run Code Online (Sandbox Code Playgroud)
奇怪的是,当我只有
"directives.language-select.Language": "Select Language",
Run Code Online (Sandbox Code Playgroud)
这条线.该网站运作良好.是什么导致这个问题?
我的网站将发送作业的电子邮件排队到jobs表中。我认为电子邮件服务器存在一些问题,它无法发送电子邮件,因此作业被卡在作业表中。现在也许有太多的工作,并且我收到此错误消息:
Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 (SQL: update `jobs` set `reserved_at` = 1510263884, `attempts` = 256 where `id` = 342)' in /var/www/vhosts/parcgilley.com/httpdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php:647
#0 /var/www/vhosts/parcgilley.com/httpdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(607): Illuminate\Database\Connection->runQueryCallback('update `jobs` s...', Array, Object(Closure))
#1 /var/www/vhosts/parcgilley.com/httpdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(477): Illuminate\Database\Connection->run('update `jobs` s...', Array, Object(Closure))
#2 /var/www/vhosts/parcgilley.com/httpdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(416): Illuminate\Database\Connection->affectingStatement('update `jobs` s...', Array)
Run Code Online (Sandbox Code Playgroud)
所以我想知道如何刷新所有排队的作业以清除表?我无法访问数据库以删除表中的数据,因此有命令行吗?我没有失败的队列表。
我想有呈现弯曲的孩子inline-block,这样border-bottom是下li的宽度,而不是容器的宽度.
显然flex儿童不能设置为内联块?
这个问题有解决方法吗?
.menu {
display: flex;
flex-flow: column;
list-style: none;
padding: 0;
}
.menu > li {
display: inline-block;
margin-bottom: 1rem;
border-bottom: 3px solid black;
}Run Code Online (Sandbox Code Playgroud)
<ul class="menu">
<li>Tab 1</li>
<li>Tab 2</li>
<li>Tab 3</li>
</ul>Run Code Online (Sandbox Code Playgroud)
我在摆弄旋转属性并意识到元素会根据其文本长度移动到不同的位置。
这是旋转部分的代码:
transform: rotate(-90deg) translate(0, -100%);
transform-origin: 0 0;
position: absolute;
bottom: 6rem;
right: -4rem;
Run Code Online (Sandbox Code Playgroud)
transform: rotate(-90deg) translate(0, -100%);
transform-origin: 0 0;
position: absolute;
bottom: 6rem;
right: -4rem;
Run Code Online (Sandbox Code Playgroud)
.stripBox {
min-height: 100px;
background-size: cover;
background-position: center center;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 1;
}
.stripBox__smallNum {
padding-left: 2rem;
}
.stripBox__heading {
padding-right: 1rem;
color: white;
font-size: 1.2rem;
}
.stripBox--right {
flex-direction: row-reverse;
}
.stripBox--right .stripBox__smallNum {
padding-right: 1rem;
}
.stripBox--right .stripBox__heading {
padding-left: 2rem;
}
.stripBox:nth-child(1) …Run Code Online (Sandbox Code Playgroud)我想在SVG中的路径上创建动画。它在同一原点前后缩放。问题是我当前的解决方案适用于Chrome,但不适用于Firefox。
.svg-map-pg-logo {
animation-name: star;
animation-duration: 0.5s;
animation-iteration-count: infinite;
}
@keyframes star {
0% {
transform: scale(1, 1);
transform-origin: center center;
}
100% {
transform: scale(1.2, 1.2);
transform-origin: center center;
}
}
Run Code Online (Sandbox Code Playgroud)
在Firefox上,路径会在移向某个方向时缩放。在Chrome上,它只能按其原始尺寸缩放。如何使秤不动?
https://codepen.io/joshuajazleung/pen/EbbgBN
<div class="outer">
<div class="inner">
<img src="https://placehold.it/300x200" alt="">
<div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Optio animi harum impedit ex esse labore, placeat, tempore sapiente nisi cupiditate fugiat soluta ullam dicta ducimus accusamus tenetur consequuntur nesciunt earum!</div>
</div>
</div>
.outer {
background: red;
position: relative;
height: calc(100% - 60px);
}
.inner {
position: relative;
top: -100px;
}
Run Code Online (Sandbox Code Playgroud)
因为.inner移到顶部一点,以减少.out的总体空间,所以我使用
height: calc(100% - 50px); // my logic is that it's div's height minus 50px
Run Code Online (Sandbox Code Playgroud)
但这不起作用,想知道为什么吗?