Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 21942

Zegar w JS, Brackets wyrzuca błędy

$
0
0

Hej, napisałem w JS prosty zegar:

function counting() {
        
        var today = new Date();
    
        var day = today.getDate();
            if (day < 10) day = "0" + day;
        var month = today.getDay() + 1; //+1 dlatego, że miesiące są numerowane od 0 do 11
            if (month < 10) month = "0" + month;
        var year = today.getFullYear();

        var hour = today.getHours();
            if (hour < 10) hour = "0" + hour; // if, żeby dodwało zera przed liczbą, która składa się z jednej cyfry
        var minute = today.getMinutes();
            if (minute < 10) minute = "0" + minute;
        var second = today.getSeconds();
            if (second < 10) second = "0" + second;
         
        document.getElementById("timer").innerHTML = day + "." + month + "."+year + " / " + hour + ":" + minute + ":" + second;
            
        setTimeout("counting()", 1000);
        }

 

Wszystko działa jak należy, natomiast w Bracketsie, w którym edytuje wyskoczyło mi ponad 30 błędów. Nie rozumiem, czy są to bardziej wskazówki, skoro wszytko działa? I dlaczego aż tak dużo?

3Missing 'use strict' statement.var today = new Date();
3Expected 'var' at column 5, not column 9.var today = new Date();
5Expected 'var' at column 5, not column 9.var day = today.getDate();
5Combine this with the previous 'var' statement.var day = today.getDate();
6Expected 'if' at column 5, not column 13.if (day < 10) day = "0" + day;
6Expected '{' and instead saw 'day'.if (day < 10) day = "0" + day;
6Expected 'day' at column 5, not column 27.if (day < 10) day = "0" + day;
7Expected 'var' at column 5, not column 9.var month = today.getDay() + 1; //+1 dlatego, że miesiące są numerowane od 0 do 11
7Combine this with the previous 'var' statement.var month = today.getDay() + 1; //+1 dlatego, że miesiące są numerowane od 0 do 11
8Expected 'if' at column 5, not column 13.if (month < 10) month = "0" + month;
8Expected '{' and instead saw 'month'.if (month < 10) month = "0" + month;
8Expected 'month' at column 5, not column 29.if (month < 10) month = "0" + month;
9Expected 'var' at column 5, not column 9.var year = today.getFullYear();
9Combine this with the previous 'var' statement.var year = today.getFullYear();
11Expected 'var' at column 5, not column 9.var hour = today.getHours();
11Combine this with the previous 'var' statement.var hour = today.getHours();
12Expected 'if' at column 5, not column 13.if (hour < 10) hour = "0" + hour; // if, żeby dodwało zera przed liczbą, która składa się z jednej cyfry
12Expected '{' and instead saw 'hour'.if (hour < 10) hour = "0" + hour; // if, żeby dodwało zera przed liczbą, która składa się z jednej cyfry
12Expected 'hour' at column 5, not column 28.if (hour < 10) hour = "0" + hour; // if, żeby dodwało zera przed liczbą, która składa się z jednej cyfry
13Expected 'var' at column 5, not column 9.var minute = today.getMinutes();
13Combine this with the previous 'var' statement.var minute = today.getMinutes();
14Expected 'if' at column 5, not column 13.if (minute < 10) minute = "0" + minute;
14Expected '{' and instead saw 'minute'.if (minute < 10) minute = "0" + minute;
14Expected 'minute' at column 5, not column 30.if (minute < 10) minute = "0" + minute;
15Expected 'var' at column 5, not column 9.var second = today.getSeconds();
15Combine this with the previous 'var' statement.var second = today.getSeconds();
16Expected 'if' at column 5, not column 13.if (second < 10) second = "0" + second;
16Expected '{' and instead saw 'second'.if (second < 10) second = "0" + second;
...  
21Expected '}' at column 1, not column 9.}

Viewing all articles
Browse latest Browse all 21942

Trending Articles


TRX Antek AVT - 2310 ver 2,0


Автовишка HAULOTTE HA 16 SPX


POTANIACZ


Zrób Sam - rocznik 1985 [PDF] [PL]


Maxgear opinie


BMW E61 2.5d błąd 43E2 - klapa gasząca a DPF


Eveline ➤ Matowe pomadki Velvet Matt Lipstick 500, 506, 5007


Auta / Cars (2006) PLDUB.BRRip.480p.XviD.AC3-LTN / DUBBING PL


Peugeot 508 problem z elektroniką


AŚ Jelenia Góra