Jump to content

simple js time code

Letgomyleghoe

hi! im trying to show a friend some simple java script shit but cant figure out whats wrong with this for the life of me, the button pops up, it has my "YOU WANT THE TIME!?" but when i click it nothing happens

<html>
<title>why?</title>

<head>
<script>
function TIME()  {
    document.getElementById("time").innerHTML = date();    
}
</script>
</head>

<body>
<button onclick ="TIME();">YOU WANT THE TIME!?</button>
<p Id ="time"></p>
</body>
</html>

 

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

NVM, missed a capitol "D'" on "date"  

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Slottr said:

Capitalize the D in date

Yeah just found that 🤦‍♂️
 

it was pissing me off to an unbelievable level 😂

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, scuff gang said:

Yeah just found that 🤦‍♂️
 

it was pissing me off to an unbelievable level 😂

That's CS for ya in a nutshell

Community Standards || Tech News Posting Guidelines

---======================================================================---

CPU: R5 3600 || GPU: RTX 3070|| Memory: 32GB @ 3200 || Cooler: Scythe Big Shuriken || PSU: 650W EVGA GM || Case: NR200P

Link to comment
Share on other sites

Link to post
Share on other sites

You may want to get into the habit of checking the JavaScript console when you have problems like this, as it usually prints out useful debugging information.

 

Screenshot_2020-03-31_09-49-17.png

The Eight Fallacies of Distributed Computing

Essentially everyone, when they first build a distributed application, makes the following eight assumptions. All prove to be false in the long run and all cause big trouble and painful learning experiences.

  1. The network is reliable
  2. Latency is zero
  3. Bandwidth is infinite
  4. The network is secure
  5. Topology doesn’t change
  6. There is one administrator
  7. Transport cost is zero
  8. The network is homogeneous

        — Peter Deutsch

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Slottr said:

That's CS for ya in a nutshell

Yeah, haven’t messed around with JS for quite a while, decided I would try and show my friend a little, he’s trying to get a website up for his kombucha business 

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, vlads_ said:

You may want to get into the habit of checking the JavaScript console when you have problems like this, as it usually prints out useful debugging information.

 

Screenshot_2020-03-31_09-49-17.png

I have been, I couldn’t figure out why the date was not defined tho 😂

 

it turns out all I needed was the capital

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

you can also write in the console

 

image.png.53b2ec950b324459e5de81d72c96a806.png

 

would have given you just like intellisense

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/31/2020 at 8:52 AM, scuff gang said:

I would try and show my friend a little, he’s trying to get a website up for his kombucha business 

Hmm well, I don't what exactly he was trying. But as much as it is fun to code a website yourself, usually for small businesses an out of the box solution makes sence. Use something like wix or squarespace for the most complete and hassle free experience or if you wan't to keep a bit more control and maybe host it yourself use Wordpress or something similar.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, lal12 said:

Hmm well, I don't what exactly he was trying. But as much as it is fun to code a website yourself, usually for small businesses an out of the box solution makes sence. Use something like wix or squarespace for the most complete and hassle free experience or if you wan't to keep a bit more control and maybe host it yourself use Wordpress or something similar.

I would consider myself decent at java script I just get frustrated at the small things. I used to use word press until I learned html, and I have used wix but I found it more difficult, and less customizable than just coding it out in html.

AMD blackout rig

 

cpu: ryzen 5 3600 @4.4ghz @1.35v

gpu: rx5700xt 2200mhz

ram: vengeance lpx c15 3200mhz

mobo: gigabyte b550 auros pro 

psu: cooler master mwe 650w

case: masterbox mbx520

fans:Noctua industrial 3000rpm x6

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, scuff gang said:

I would consider myself decent at java script I just get frustrated at the small things. I used to use word press until I learned html, and I have used wix but I found it more difficult, and less customizable than just coding it out in html.

I meant it more as an advice for your friend and his business than for yourself ^^

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×