skip to Main Content

javascript not available in console – Jquery

I am writing script tags from the console to my test.html file: test.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery load() Demo</title> </head> <body> <p>nothing</p> </body> <script> </script> from console: var script = document.createElement('script');script.src = "https://code.jquery.com/jquery-3.6.4.min.js";document.getElementsByTagName('head')[0].appendChild(script); var script2 =…

VIEW QUESTION

Why is my console not printing the message after every minute passed, does useEffect hook runs only once? – Reactjs

import React, { useState, useEffect } from 'react'; function DigitalClock() { const[currentTime, setCurrentTime] = useState(new Date()); useEffect(()=>{ const interval = setInterval(()=>{ setCurrentTime(new Date()); },1000); return () => clearInterval(interval); },[]); useEffect(()=>{ const second = currentTime.getSeconds(); if(second===0){ console.log("another minute passed"); } },[currentTime])…

VIEW QUESTION
Back To Top
Search