Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
maboglia committed Dec 19, 2017
1 parent 5a9ccac commit 51bf10e
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 2 deletions.
34 changes: 34 additions & 0 deletions OOP6/lab4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
<style>
.nascondi {
display: none;
}
</style>
</head>

<body>

<h1>keys() foreach() e arrow functions </h1>




<script>
const o = {
a: 1,
b: 2,
c: 3
};
Object.keys(o).forEach(prop => console.log(`${prop}: ${o[prop]}`));
</script>

</body>

</html>
48 changes: 48 additions & 0 deletions TMWD2018/010_confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<DOCTYPE html/>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>uso confirm</title>
</head>
<body>



<p id="paragrafo1">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</p>

<p>paragrafo 2</p>

<script type="text/javascript">
var sicuro = confirm("Sei proprio sicuro?");
console.log(sicuro);
console.log(typeof sicuro);

if (sicuro)
document.write("Bene! Procediamo...");
else
document.write("Ok, pensaci ancora un attimo...");

if ( confirm("mi vuoi bene?") )
document.write("anch'io");
else
document.write("anch'io");

//operatore ternario
(sicuro) ? document.write("sì, ce ne andiamo!") : document.write("no, restiamo!");


</script>




</body>
</html>
40 changes: 40 additions & 0 deletions TMWD2018/lab2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
</head>

<body>

<button type="">localizzami</button>

<script>
var d = document.getElementsByTagName("button");
//dichiaro la fun stampa per ricevere (attraverso argomento) le info sulla mia posizione
function stampaPosizione(argomento) {
console.info("qui vi parla la funzione stampaPosizione");
console.log(argomento.coords.latitude);
console.log(argomento.coords.longitude);

location.href = "https://www.google.it/maps/@" +
argomento.coords.latitude +
"," +
argomento.coords.longitude;


}


d[0].addEventListener("click", function(params) {
console.info("qui vi parla l'eventListener'");
var posizione = navigator.geolocation.getCurrentPosition(stampaPosizione);
console.log(posizione);
});
</script>
</body>

</html>
11 changes: 9 additions & 2 deletions appunti/CorsoJs.0.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Corso Javascript

## JavaScript è un linguaggio di programmazione

utilizzato comunemente come parte dell'esperienza di navigazione, permette di creare interazioni con l'utente,
controllare la navigazione, gestire la comunicazione asincrona, e modificare il contenuto del documento.

___Fonte: https://en.wikipedia.org/wiki/JavaScript___
___Fonte: <https://en.wikipedia.org/wiki/JavaScript___>

## ruolo di js nel web design

Expand All @@ -13,6 +14,7 @@ ___Fonte: https://en.wikipedia.org/wiki/JavaScript___
* Js: comportamento

## Risorse disponibili online

* [Javascript reference](https://developer.mozilla.org/it/docs/Web/JavaScript)
* [JS the right way](http://jstherightway.org/)
* [JSinfo](https://javascript.info/)
Expand All @@ -21,12 +23,17 @@ ___Fonte: https://en.wikipedia.org/wiki/JavaScript___
* [Udacity Course](https://www.udacity.com/course/intro-to-javascript--ud803)
* [html.it](http://www.html.it/guide/guida-javascript-di-base/)

## Hello, World!
## Hello, World

Hello, World! nel browser

```javascript
alert('Hello, World!')

```

Hello, World! nel terminale

```javascript
console.log('Hello, World!')
```
Expand Down
18 changes: 18 additions & 0 deletions appunti/appunti.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@
* Angular components, routing
* Angular services


### Arrow


```javascript
const f1 = function() { return "hello!"; }
// OR
const f1 = () => "hello!";

const f2 = function(name) { return `Hello, ${name}!`; }
// OR
const f2 = name => `Hello, ${name}!`;

const f3 = function(a, b) { return a + b; }
// OR
const f3 = (a,b) => a + b;

```

0 comments on commit 51bf10e

Please sign in to comment.