update debug-js
This commit is contained in:
Родитель
8cb9a74bf2
Коммит
9998e9ada5
|
@ -1,20 +0,0 @@
|
|||
/* Copyright 2016 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License. */
|
||||
function inputsAreEmpty() {
|
||||
if (getNumber1() === '' || getNumber2() === '') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -19,21 +19,30 @@
|
|||
<title>Demo: Get Started Debugging JavaScript with Chrome DevTools</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
h1 {
|
||||
font-size: 1.5em
|
||||
}
|
||||
input, button {
|
||||
width: 50%;
|
||||
height: 25%;
|
||||
min-width: 72px;
|
||||
min-height: 36px;
|
||||
border: 1px solid grey;
|
||||
margin: 1%;
|
||||
}
|
||||
label, input, button {
|
||||
display: block;
|
||||
}
|
||||
input {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Demo: Get Started Debugging JavaScript with Chrome DevTools</h1>
|
||||
<input placeholder="Number 1">
|
||||
<input placeholder="Number 2">
|
||||
<label for="num1">Number 1</label>
|
||||
<input placeholder="Number 1" id="num1">
|
||||
<label for="num2">Number 2</label>
|
||||
<input placeholder="Number 2" id="num2">
|
||||
<button>Add Number 1 and Number 2</button>
|
||||
<p></p>
|
||||
<script src="get-started-1.js"></script>
|
||||
<script src="get-started-2.js"></script>
|
||||
<script src="get-started.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -18,6 +18,13 @@ function onClick() {
|
|||
}
|
||||
updateLabel();
|
||||
}
|
||||
function inputsAreEmpty() {
|
||||
if (getNumber1() === '' || getNumber2() === '') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function updateLabel() {
|
||||
var addend1 = getNumber1();
|
||||
var addend2 = getNumber2();
|
Загрузка…
Ссылка в новой задаче