Windows 10: Learning JavaScript

Discus and support Learning JavaScript in Windows 10 Software and Apps to solve the problem; I have an idea for a script I'd like to write, but I know virtually nothing about JavaScript except that I would need to use that language for my... Discussion in 'Windows 10 Software and Apps' started by jayv2251, Jul 22, 2017.

  1. jayv2251 Win User

    Learning JavaScript


    I have an idea for a script I'd like to write, but I know virtually nothing about JavaScript except that I would need to use that language for my application. I have some script writing background but I'm very rusty. Last time I did any scripting was in Bash for Linux over 10 years ago. Before that I was writing programs in Basic for my high school's Commodore Pet and 64's.

    What I'm trying to do is no big secret at all. I'm looking to make a time clock appear on a website once I load it. This time clock would allow me to "punch in" to start a day, "punch out" for lunch, coffee break, or what ever reason I wanted it to pause. Once break is over, punch back in, then a final punch out for the day. I've spend the last hour or more googling to see if I could find a "beginner's" guide that would show a very basic clock like this. Yes there's clocks, and I'm starting to get the gist of the lingo, but none of them allow the start, stop, start, stop that I not only want...I NEED!

    :)
     
    jayv2251, Jul 22, 2017
    #1

  2. Since mango, why cant I "find" anymore in IE on windows phone 7??

    Many thanks for that! A rather nifty piece of Javascript there!!



    I didnt know you can paste Javascript into the address? How bizzare! Why?! YOu learn something everyday.



    Very helpful thankyou.
     
    Soft Techy, Jul 22, 2017
    #2
  3. Nokia Browser 7.1.35

    Not working properly it shows please enable the javascript but javascripts is olready on what to do now
     
    Haroon91711, Jul 22, 2017
    #3
  4. axe0 New Member

    Learning JavaScript

    Hi jayv2251,

    I have a script that does something like this originally written for a WBS project. The only issue being that I wrote this script for multiple timers. I never paid enough attention to get it 100% working though.

    Here is the script, I'm aware that there may be lots of bugs and may also be a bit improperly written.
    Code: var curHour; var curMin; var curSec; var time = { totalSec: 0, start: function(id){ var self = this; self.id = id; var totalWorked; self.totalWorked = $('#Do' + self.id).text().split(':'); this.interval = setInterval(function(){ console.log($('#Do' + self.id).text().split(':')); self.totalSec += 1; curHour = Math.floor(self.totalWorked[0] + (self.totalSec / 3600)) ; curMin = Math.floor(self.totalWorked[1] + (self.totalSec / 60 % 60)); curSec = Math.floor(self.totalWorked[2] + (self.totalSec % 60)); if(curHour <= "9") curHour = '0' + curHour; if(curMin <= "9") curMin = '0' + curMin; if(curSec <= "9") curSec = '0' + curSec; $('#Do' + self.id).text(curHour + ':' + curMin + ':' + curSec); }, 1000); }, pause: function(){ clearInterval(this.interval); delete this.interval; }, resume: function(id){ if(typeof this.interval == 'undefined') this.start(id); } }; function startTimer(id){ time.start(id); var pauseBtn = $('<button type=button class="btn btn-primary btn-pause" value='+id+' id=pause'+id+' onclick=pauseTime('+id+');>pause tijd</button>'); $('#startTime' + id).replaceWith(pauseBtn); } function pauseTime(id){ time.pause(); var resumeBtn = $('<button type=button class="btn btn-primary" id=resume'+id+' value='+id+' onclick=resumeTime('+id+');>resume tijd</button>'); $('#pause' + id).replaceWith(resumeBtn); $.ajax({ url: 'http://localhost/wbs/public/saveTime.php', type: "post", dataType: 'text', data: {"id": id, "time": $('#Do' + id).text()}, success: function(){location.reload();}, error: function(xhr, textStatus, errorThrown){ console.log('Error code: ' + errorThrown); } }); } function resumeTime(id){ time.resume(id); var pauseBtn = $('<button type=button class="btn btn-primary" id=pause'+id+' value='+id+' onclick=pauseTime('+id+');>pause tijd</button>'); $('#resume' + id).replaceWith(pauseBtn); } totalSec = 0;[/quote]
     
  5. pyramid10 Win User
    pyramid10, Apr 5, 2018
    #5
Thema:

Learning JavaScript

Loading...
  1. Learning JavaScript - Similar Threads - Learning JavaScript

  2. how to not accidentally hover over "Learn about this picture"?

    in Windows 10 Gaming
    how to not accidentally hover over "Learn about this picture"?: I like spotlight, but i just want the picture, very often that little icon is right underneath where my mouse stops to rest, and then I have to click off of it.Is there some way of disabling hovering from activating that icon, or in fact disable hover from popping a tooltip...
  3. how to not accidentally hover over "Learn about this picture"?

    in Windows 10 Software and Apps
    how to not accidentally hover over "Learn about this picture"?: I like spotlight, but i just want the picture, very often that little icon is right underneath where my mouse stops to rest, and then I have to click off of it.Is there some way of disabling hovering from activating that icon, or in fact disable hover from popping a tooltip...
  4. This already happened to my pc 9times, and i just learn recently diagnostic data viewer.

    in Windows 10 Gaming
    This already happened to my pc 9times, and i just learn recently diagnostic data viewer.: Windows Description Faulting Application Path: C:\Windows\System32\WerFault.exe Creation Time: 4/24/2025 12:04:43 PM Problem: Shut down unexpectedly Status: Report sent Problem signature Problem Event Name: BlueScreen Code: 50 Parameter 1: ffffcda286f0df00 Parameter 2: 2...
  5. This already happened to my pc 9times, and i just learn recently diagnostic data viewer.

    in Windows 10 Software and Apps
    This already happened to my pc 9times, and i just learn recently diagnostic data viewer.: Windows Description Faulting Application Path: C:\Windows\System32\WerFault.exe Creation Time: 4/24/2025 12:04:43 PM Problem: Shut down unexpectedly Status: Report sent Problem signature Problem Event Name: BlueScreen Code: 50 Parameter 1: ffffcda286f0df00 Parameter 2: 2...
  6. Not able to find certificate in microsoft learn transcript

    in Windows 10 Gaming
    Not able to find certificate in microsoft learn transcript: I successfully completed Ai900 certification exam in a perason vue center today morning. I got an email from Microsoft confirming that i have obtained certificate, but i cant find certificate in my learn.microsoft transcript....
  7. Not able to find certificate in microsoft learn transcript

    in Windows 10 Software and Apps
    Not able to find certificate in microsoft learn transcript: I successfully completed Ai900 certification exam in a perason vue center today morning. I got an email from Microsoft confirming that i have obtained certificate, but i cant find certificate in my learn.microsoft transcript....
  8. How to delete 'Learn about this picture' icon on desktop?

    in Windows 10 Gaming
    How to delete 'Learn about this picture' icon on desktop?: There's an icon called 'Learn about this picture' on my Windows desktop, which's very annoying, as soon as I turned on the computer, it expanded automatically, and displayed four pictures for the user to choose, I wanna remove or delete it, I draged it into trash yet it still...
  9. How to delete 'Learn about this picture' icon on desktop?

    in Windows 10 Software and Apps
    How to delete 'Learn about this picture' icon on desktop?: There's an icon called 'Learn about this picture' on my Windows desktop, which's very annoying, as soon as I turned on the computer, it expanded automatically, and displayed four pictures for the user to choose, I wanna remove or delete it, I draged it into trash yet it still...
  10. Can't use personal account with active Azure subscription on Microsoft Learn AZ-900

    in Windows 10 Gaming
    Can't use personal account with active Azure subscription on Microsoft Learn AZ-900: Hello,When I attempt to use my account with active pay-as-you-go subscription for the Azure Fundamentals AZ-900 exercise modules, I receive the following error: "Selected user account does not exist in tenant 'Microsoft Services' and cannot access the application...