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. Cannot sign into Microsoft Learn account

    in Windows 10 Gaming
    Cannot sign into Microsoft Learn account: No, no, no. This should not be a ticket. Same issue 2 years later. I'm logged in, and the system recognizes me, but I am prompted to login again and again and again., Can't see my profile and certifications. This is a known issue and a huge waste of my time....
  3. Cannot sign into Microsoft Learn account

    in Windows 10 Software and Apps
    Cannot sign into Microsoft Learn account: No, no, no. This should not be a ticket. Same issue 2 years later. I'm logged in, and the system recognizes me, but I am prompted to login again and again and again., Can't see my profile and certifications. This is a known issue and a huge waste of my time....
  4. How to permanently remove “Learn about this picture” icon on my desktop?

    in Windows 10 Gaming
    How to permanently remove “Learn about this picture” icon on my desktop?: Whenever I start my computer the app starts and disrupts my wallpapers I already have on my pc. Whenever I right click it, it takes me somewhere else instead of the usual options like deleting it. Also I try to drag it do the recycle bin it doesn’t do anything. I also tried...
  5. How to permanently remove “Learn about this picture” icon on my desktop?

    in Windows 10 Software and Apps
    How to permanently remove “Learn about this picture” icon on my desktop?: Whenever I start my computer the app starts and disrupts my wallpapers I already have on my pc. Whenever I right click it, it takes me somewhere else instead of the usual options like deleting it. Also I try to drag it do the recycle bin it doesn’t do anything. I also tried...
  6. Why do i need to run a command prompt to remove the "learn about this picture" icon on my...

    in Windows 10 Software and Apps
    Why do i need to run a command prompt to remove the "learn about this picture" icon on my...: Why is it that they've added a new intrusive feature to the desktop that can't be removed by orienting the GUI. It is quite intrusive and annoying....
  7. Why do i need to run a command prompt to remove the "learn about this picture" icon on my...

    in Windows 10 Gaming
    Why do i need to run a command prompt to remove the "learn about this picture" icon on my...: Why is it that they've added a new intrusive feature to the desktop that can't be removed by orienting the GUI. It is quite intrusive and annoying....
  8. Is there a "change log" or something that I can access to learn about recent Phone Link...

    in Windows 10 Gaming
    Is there a "change log" or something that I can access to learn about recent Phone Link...: Earlier this morning 01-19-2024 I applied "Phone Link" updates to my laptop via the Microsoft store.I also applied updates to the "Link to Wndows" app on my Android phone.Everything works fine. As far as I can tell.And that "As far as I can tell" is what's behind my...
  9. Is there a "change log" or something that I can access to learn about recent Phone Link...

    in Windows 10 Software and Apps
    Is there a "change log" or something that I can access to learn about recent Phone Link...: Earlier this morning 01-19-2024 I applied "Phone Link" updates to my laptop via the Microsoft store.I also applied updates to the "Link to Wndows" app on my Android phone.Everything works fine. As far as I can tell.And that "As far as I can tell" is what's behind my...
  10. cannot add account to my profile at Microsoft Learn

    in Windows 10 Gaming
    cannot add account to my profile at Microsoft Learn: On my Microsoft Learn Account Management page at learn.microsoft.com, it says "Linking a personal account will allow you to access your learning progress regardless of your employment status." I am trying to do this as it currently says "No linked accounts." Every time I...