7-Jul-16 JavaScript Examples. Getting the date var d = new Date() document.write(d.getDate() + "/") document.write((d.getMonth() + 1) + "/") document.write(d.getFullYear())

Slides:



Advertisements
Similar presentations
Line Efficiency     Percentage Month Today’s Date
Advertisements

Unit Number Oct 2011 Nov 2011 Dec 2011 Jan 2012 Feb 2012 Mar 2012 Apr 2012 May 2012 Jun 2012 Jul 2012 Aug 2012 Sep (3/4 Unit) 7 8 Units.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Basic View Main Menus Sub Menus 9-Aug-01 8-Aug-01 7-Aug-01 6-Aug-01
SPOUSE LEADERSHIP DEVELOPMENT COURSE (SLDC) CLASS 68
Jan 2016 Solar Lunar Data.
IT Strategy Roadmap Template

Analyzing patterns in the phenomena
Q1 Jan Feb Mar ENTER TEXT HERE Notes


Project timeline # 3 Step # 3 is about x, y and z # 2
Average Monthly Temperature and Rainfall
ABT & Frequency.

2016 FIT FOR PERFORMANCE Weight Control Program




Mammoth Caves National Park, Kentucky
2017 Jan Sun Mon Tue Wed Thu Fri Sat
Timeline PowerPoint Template



Gantt Chart Enter Year Here Activities Jan Feb Mar Apr May Jun Jul Aug
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Free PPT Diagrams : ALLPPT.com

FY 2019 Close Schedule Bi-Weekly Payroll governs close schedule
SPOUSE LEADERSHIP DEVELOPMENT COURSE (SLDC) CLASS 69

Step 3 Step 2 Step 1 Put your text here Put your text here
Calendar Year 2009 Insure Oklahoma Total & Projected Enrollment
MONTH CYCLE BEGINS CYCLE ENDS DUE TO FINANCE JUL /2/2015
Jan Sun Mon Tue Wed Thu Fri Sat



©G Dear 2008 – Not to be sold/Free to use
Electricity Cost and Use – FY 2016 and FY 2017
Unit 6 part 6 Test Javascript Test.


JavaScript Examples 27-Apr-19.
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
JavaScript Examples 30-Apr-19.
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Free PPT Diagrams : ALLPPT.com


Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Project timeline # 3 Step # 3 is about x, y and z # 2
JavaScript Examples 12-Jul-19.
SPOUSE LEADERSHIP DEVELOPMENT COURSE (SLDC) CLASS 70
TIMELINE NAME OF PROJECT Today 2016 Jan Feb Mar Apr May Jun

Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Presentation transcript:

7-Jul-16 JavaScript Examples

Getting the date var d = new Date() document.write(d.getDate() + "/") document.write((d.getMonth() + 1) + "/") document.write(d.getFullYear()) 27/09/2004

Getting and formatting the date var d=new Date() var weekday=new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday","Saturday") var monthname=new Array("Jan", "Feb", "Mar","Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") document.write(weekday[d.getDay()] + ", ") document.write(monthname[d.getMonth()] + " " + d.getDate() + ", ") document.write(d.getFullYear()) Monday, Sep 27, 2004

Getting a random number The following code gets a random floating-point number between 0 and 1: document.write(Math.random())

Getting a random integer The following code gets a random integer between 1 and 10: var max = 10; number=Math.random()*max + 1; document.write(Math.floor(number)); 5

Displaying an alert box The following code displays an alert box when a button is clicked: // Buttons can only occur within forms

Telling what happened In my Concise JavaScript, part 2, I have code that shows what events occur when the user takes various actions In the of the HTML page I define: For each form element, I have a handler for every (plausible) event

Telling what happened (Button)

The End