Chapter 8. Programming the Web. For the book Mapping in the Cloud Guilford Press Michael P. Peterson
|
|
- Jocelyn Anderson
- 6 years ago
- Views:
Transcription
1 Chapter 8 Programming the Web For the book Mapping in the Cloud Guilford Press Michael P. Peterson
2 Javascript in Body Code Result <html> <body> This is a normal HTML document. <br> <script type= text/javascript > document.write ( This is JavaScript! ) <br> Back in HTML again. </body> </html> This is a normal HTML document. This is JavaScript! Back in HTML again.
3 Body and calculaaon Code <html> <body> <script type="text/javascript"> var x = 2 * 2 document.write("x = ", x) </body> </html> Result x = 4
4 FuncAon in the head Code Result <head> The function returned 25. <script LANGUAGE="JavaScript"> All done. function square(number) { return number * number <body> <script> document.write("the square of 5 is ", square(5), ".") <P>All done.</p> </body>
5 FuncAon in the.js file Code function square(number) { return number * number Result A separate file called common.js <head> The function returned 25. <title>referencing a file of functions</title> All done. <script src="common.js"> <body> <script> document.write("the square of 5 is ", square(5), ".") <p>all done.</p> </body>
6 API as an external.js file Code <head> <title>google Maps JavaScript API Example</title> <script type= text/javascript src= >
7 Array Code Result <html> <title>calculate the min and max of a dataset</title> <h3>calculating the min and max of a dataset</h3> <script type="text/javascript"> var popdata = new Array (33185,6931,372,783,492,5668,11132,2185,3354, 43954,7341,8595,25963,8819,3811,5934,9865,6564,10113,9660,11242,20587,8466, 25018,1958,6170,36171,492003,2109,6259,3348,2729,5003,23365,1995,1790,1978, 660,2454,55555,9490,3446,1029,2926,10610,756,6736,7874,4683,6701,8250,892, 3710,8812,267135,35865,749,656,497,35279,7954,5171,3705,7247,4650, ,2992,9442,7564,31962,5349,10865,8656,1544,14155,142637,20344, ,5571,3083,1403,6570,5317,629,7273,4373,20044,9196,3701,823,14502); //initialize min and max to values beyond the range var min= ; var max= ; //set n equal to the number of values in the array The minimum value is 372. The maximum value is
8 43954,7341,8595,25963,8819,3811,5934,9865,6564,10113,9660,11242,20587,8466, 25018,1958,6170,36171,492003,2109,6259,3348,2729,5003,23365,1995,1790,1978, 660,2454,55555,9490,3446,1029,2926,10610,756,6736,7874,4683,6701,8250,892, 3710,8812,267135,35865,749,656,497,35279,7954,5171,3705,7247,4650, ,2992,9442,7564,31962,5349,10865,8656,1544,14155,142637,20344, ,5571,3083,1403,6570,5317,629,7273,4373,20044,9196,3701,823,14502); //initialize min and max to values beyond the range var min= ; var max= ; //set n equal to the number of values in the array var n=93; //loop through all values and reset min and max for (var i = 0; i < n; i++) { if (popdata[i] < min) { min=popdata[i] if (popdata[i] > max) { max=popdata[i] //write dataset and min and max document.write('<b>nebraska populations by county</b>: '+ popdata) document.write('<p>the minimum value is ' + min + '.') document.write('<p>the maximum value is ' + max+ '.') </html>
9 Code Sort function initialize() { var popdata = new Array (33185,6931,372,783,492,5668,11132,2185,3354, 43954,7341,8595,25963,8819,3811,5934,9865,6564,10113,9660,11242,20587,8466, 25018,1958,6170,36171,492003,2109,6259,3348,2729,5003,23365,1995,1790,1978, 660,2454,55555,9490,3446,1029,2926,10610,756,6736,7874,4683,6701,8250,892, 3710,8812,267135,35865,749,656,497,35279,7954,5171,3705,7247,4650, ,2992,9442,7564,31962,5349,10865,8656,1544,14155,142637,20344, ,5571,3083,1403,6570,5317,629,7273,4373,20044,9196,3701,823,14502); var n=93; //write unsorted data document.write('<h3>unsorted Nebraska populations by county:</h3> '+ popdata); // call sort function sortdata(n,popdata); //write sorted data document.write('<h3>sorted Nebraska populations by county:</h3> '+ popdata);
10 //write unsorted data document.write('<h3>unsorted Nebraska populations by county:</h3> '+ popdata); // call sort function sortdata(n,popdata); //write sorted data document.write('<h3>sorted Nebraska populations by county:</h3> '+ popdata); <script type="text/javascript"> function sortdata(n,data) { var i, j, swapped for(i = 0; i < n; i++) { var swapped = false; for(j = 0; j < (n-1); j++) { if(data[j] > data[j+1]) { swap = data[j+1]; data[j+1] = data[j]; data[j] = swap; swapped = true; if (swapped==false) break; return data // Chk if variables need swapping // The following 3 lines swap the variables // if the swapped flag isn't changed then there is //point continuing as all values are in order
11 // call the Time function <body onload="time()"> </body> The Date object Code <script type="text/javascript"> function Time() { var currenttime = new Date() var hours = currenttime.gethours() var minutes = currenttime.getminutes() var seconds = currenttime.getseconds() // call the AddZero function to add a // zero in front of numbers that are less // than 10 hours = AddZero(hours) minutes = AddZero(minutes) seconds = AddZero(seconds) Result 19 hours 23 minutes 06 seconds // write out the time document.write("<b>" + hours + " hours " + minutes + " minutes " + seconds + " seconds </b>") function AddZero(i) { if (i<10) {i="0" + i return i
12 Morning or ajernoon Code <script type="text/javascript"> var d = new Date() var time = d.gethours() if (time < 12) { document.write("<b>good morning</b>") else { document.write("<b>good Afternoon</b>") Result If it is before 12: Good Morning If it is after 12: Good Afternoon
13 Code <script type="text/javascript"> function Time2() { var currenttime = new Date() var hours = currenttime.gethours() var minutes = currenttime.getminutes() Result 7:54 PM AM and PM var suffix = "AM"; if (hours >= 12) { suffix = "PM"; hours = hours - 12; if (hours == 0) { hours = 12; if (minutes < 10) minutes = "0" + minutes document.write("<b>" + hours + ":" + minutes + " " + suffix + "</b>") // call the Time2 function <body onload="time2()"> </body>
14 CounAng the days Code Result <script language="javascript"> function CalculateDays() { var now = new Date(); var theevent = new Date("Jan :00:01"); var seconds = (theevent - now) / 1000; var minutes = seconds / 60; var hours = minutes / 60; var days = hours / 24; days = Math.round(days); There are 376 days before / since January 19, document.write("there are ", days, " days before / since January 19, 2009.") <body onload="calculatedays()"> </body>
15 Code Result In days, minutes, and seconds <html> <head> <script LANGUAGE="JavaScript"> // The function update is called by // itself to constantly update the values // for days, hours, minutes, seconds var now = new Date(); var theevent = new Date("Jan :00:01"); var seconds = (theevent - now) / 1000; var minutes = seconds / 60; var hours = minutes / 60; var days = hours / 24; ID=window.setTimeout("update();", 1000); function update() { now = new Date(); seconds = (theevent - now) / 1000; seconds = Math.round(seconds); minutes = seconds / 60; minutes = Math.round(minutes); hours = minutes / 60; hours = Math.round(hours); days = hours / 24; days = Math.round(days); document.form1.days.value = days; document.form1.hours.value = hours; document.form1.minutes.value = minutes; document.form1.seconds.value = seconds; //this function calls itself to update the time ID=window.setTimeout("update();",1000); <body> <p>countdown To January 19, 2009, at 12:00:</p> // forms are used to display the values Countdown To January 19, 2009, at 12:00: Top of Form Days Hours Minutes Seconds (These numbers are continuously updated on the webpage.) <form name="form1"><p>days <input type="text" name="days" value="0" size="3"> Hours<br> <input type="text" name="hours" value="0" size="4"> Minutes<br> <input type="text" name="minutes" value="0" size="7"> Seconds<br> <input type="text" name="seconds" value="0" size="7"></p></form> </body> </html>
16 var hours = minutes / 60; var days = hours / 24; ID=window.setTimeout("update();", 1000); function update() { funcaon update now = new Date(); seconds = (theevent - now) / 1000; seconds = Math.round(seconds); minutes = seconds / 60; minutes = Math.round(minutes); hours = minutes / 60; hours = Math.round(hours); days = hours / 24; days = Math.round(days); document.form1.days.value = days; document.form1.hours.value = hours; document.form1.minutes.value = minutes; document.form1.seconds.value = seconds; //this function calls itself to update the time ID=window.setTimeout("update();",1000);
17 Distance calculaaon Code <html> <head> <script type="text/javascript" src="haversine.js"> <body> <form name="f" action="none!"> <p> Lat 1: <input name="lat1" value=" N" size="12"> Long 1: <input name="long1" value=" W" size="12"> </p> <p> Lat 2: <input name="lat2" value=" N" size="12"> Long 2: <input name="long2" value=" E" size="12"> </p> <p> <input type="button" value="calculate distance" onclick="result.value = LatLon.distHaversine(f.lat1.value. parsedeg(), f.long1.value.parsedeg(), f.lat2.value.parsedeg(), f.long2.value.parsedeg()). toprecision(4) + ' km'"> <input name="result" value="0" size="12"> </p> </form> <p>haversine script Chris Veness <a href= " </body> </html> <script type="text/javascript"> /* * Use Haversine formula to Calculate distance (in km) between * two points specified by latitude/longitude (in numeric degrees) LatLon.distHaversine = function(lat1, lon1, lat2, lon2) { var R = 6371; // earth's mean radius in km var dlat = (lat2-lat1).torad(); var dlon = (lon2-lon1).torad(); lat1 = lat1.torad(), lat2 = lat2.torad(); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon/2) * Math.sin(dLon/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; return d;
18 </html> <script type="text/javascript"> /* * Use Haversine formula to Calculate distance (in km) between * two points specified by latitude/longitude (in numeric degrees) LatLon.distHaversine = function(lat1, lon1, lat2, lon2) { var R = 6371; // earth's mean radius in km var dlat = (lat2-lat1).torad(); var dlon = (lon2-lon1).torad(); lat1 = lat1.torad(), lat2 = lat2.torad(); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon/2) * Math.sin(dLon/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; return d;
19 Random number object Code Result <p>the following is an example of random link in javascript </p> <script type="text/javascript"> var r=math.random() Either: if (r>0.5) { Visit our school s Website! document.write("<a href=' Our School's or Website!</a>") Visit Dr. Peterson s else Homepage! { document.write(" edu/mikep/biography.htm'>visit Dr. Peterson's Homepage!</a>")
20 Input text Code <script type="text/javascript"> function disp_prompt() { var name=prompt("please enter your name") if (name!=null && name!="") { document.write("hello " + name + "! How are you today?") Result Please enter your name Hello Michael! How are you today?
21 Code <html> <title>multiplication w/dialog</title> <h3> Mulitiplication with JavaScript</h3> <body> <button onclick="myfunction()"> START </button> <p id="demo"> </p> <script type="text/javascript"> Input function myfunction(){ var Result; var Number1 = prompt("please enter first number"); var Number2 = prompt("please enter second number"); if (Number1!= null) { Result = Number1 * Number2; document.getelementbyid("demo").innerhtml = Number1 + " x " + Number2 + " = " + Result;
22 Mouseover no_selection.gif library.gif cinema.gif bus-stop
23 Mouseover <html> <head> <title>sample JavaScript</title> <script type= text/javascript > // TASK: PRELOAD IMAGES { no_selection = new Image(330,220); no_selection.src = no_selection.gif ; selection_lib = new Image(330,220); selection_lib.src = library.gif ; selection_cin = new Image(330,220); selection_cin.src = cinema.gif ; selection_bus = new Image(330,220); selection_bus.src = busstop.gif ; function hiliter(imgbase,imgswap) // TASK: SWAP IMAGES // imgbase - name of the document image to be replaced // imgswap - name of the image object to be swapped in { document.images[imgbase].src = eval(imgswap +.src ) <body> <a name= top ></a> <img border= 0 src= no_selection.gif name= map usemap= #mousemap width= 330 height= 220 alt= Selector /> <map name= mousemap > <area shape= rect coords= 229,97,316,209 href= #top onmouseover= hiliter( map, selection_lib ); window.status= selection_lib ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > <area shape= poly coords= 15,208,15,127,75,127,75,115,147,115, 147,196,85,196,85,208 href= #top onmouseover= hiliter( map, selection_cin ); window.status= selection_cin ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > <area shape= circle coords= 127,45,10 href= #top onmouseover= hiliter( map, selection_bus ); window.status= selection_bus ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > </map> </body> </html>
24 Loading images into memory <html> <head> <title>sample JavaScript</title> <script type= text/javascript > // TASK: PRELOAD IMAGES { no_selection = new Image(330,220); no_selection.src = no_selection.gif ; selection_lib = new Image(330,220); selection_lib.src = library.gif ; selection_cin = new Image(330,220); selection_cin.src = cinema.gif ; selection_bus = new Image(330,220); selection_bus.src = busstop.gif ; function hiliter(imgbase,imgswap) // TASK: SWAP IMAGES // imgbase - name of the document image to be replaced // imgswap - name of the image object to be swapped in { document.images[imgbase].src = eval(imgswap +.src ) <body>
25 // imgbase - name of the document image to be replaced // imgswap - name of the image object to be swapped in { document.images[imgbase].src = eval(imgswap +.src ) <body> <a name= top ></a> <img border= 0 src= no_selection.gif name= map usemap= #mousemap width= 330 height= 220 alt= Selector /> <map name= mousemap > <area shape= rect coords= 229,97,316,209 href= #top onmouseover= hiliter( map, selection_lib ); window.status= selection_lib ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > <area shape= poly coords= 15,208,15,127,75,127,75,115,147,115, 147,196,85,196,85,208 href= #top onmouseover= hiliter( map, selection_cin ); window.status= selection_cin ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > <area shape= circle coords= 127,45,10 href= #top onmouseover= hiliter( map, selection_bus ); window.status= selection_bus ; return true onmouseout= hiliter( map, no_selection ); window.status= selection ; return true > </map> </body> </html> Defining mouseover hot spots
26 divs (layers) HTML- and JavaScript-Code <html> <head> <title>mouseover with JavaScript and DIV-Layers</title> 1 <script type= text/javascript > function Show(id) { if (document.getelementbyid) document.getelementbyid(id).style.visibility = visible ; function Hide(id) { if (document.getelementbyid) document.getelementbyid(id).style.visibility = hidden ; <body> 2 < div id= newdelhi style= position: absolute; left: 58; top: 100; z-index: 2; visibility: hidden >New Delhi</div> < div id= mumbai style= position: absolute; left: 72; top: 200; z-index: 2; visibility: hidden >Mumbai</div> < div id= indiamap style= position: absolute; z-index: 1; left: 1; top: 1; visibility: visible ><img src= india.gif width= 280 height= 355 border= 0 usemap= #Map ></div> <map name= Map > 3 < area shape= circle coords= 114,97,12 onmouseover= Show( newdelhi ) onmouseout= Hide( newdelhi ) > 4 < area shape= circle coords= 62,211,12 onmouseover= Show( mumbai ) onmouseout= Hide( mumbai ) > </map> </body> </html> 1 JavaScript code is inserted in a <script> tag in the head part of the html file. The function Show() searches in the document for an element with a certain id and sets the visibility of that element to visible. The function Hide() works in the same way to hide elements. 2 A <div> element is a layer. By giving that element an id-attribute, it can be addressed by scripting. The style-attributes are stylesheets and written in css-syntax. position: absolute; Sets the position of the layer. In this case, 58 px from the left and 100 px from the top. z-index: 2; Defi nes how layers are positioned over each other. The layer with the highest number is on the top. visibility: hidden; Hides this layer when the page is fi rst loaded. 3 OnMouseOver is one of the most common event handlers. It invokes JavaScript when the mouse is positioned over a hotspot. In this case, the JavaScript function Show is called with the id newdelhi. Then, JavaScript searches for the element newdelhi and makes it visible. The OnMouseOut event hides the layer in the same way. 4 Mumbai text appears when the mouse is positioned over this hotspot.
27 Mouseover with divs
28 Show and hide HTML- and JavaScript-Code <html> <head> <title>mouseover with JavaScript and DIV-Layers</title> 1 <script type= text/javascript > function Show(id) { if (document.getelementbyid) document.getelementbyid(id).style.visibility = visible ; function Hide(id) { if (document.getelementbyid) document.getelementbyid(id).style.visibility = hidden ; <body> 2 < div id= newdelhi style= position: absolute; left: 58;
29 document.getelementbyid(id).style.visibility = visible ; function Hide(id) { if (document.getelementbyid) document.getelementbyid(id).style.visibility = hidden ; <body> 2 < div id= newdelhi style= position: absolute; left: 58; top: 100; z-index: 2; visibility: hidden >New Delhi</div> < div id= mumbai style= position: absolute; left: 72; top: 200; z-index: 2; visibility: hidden >Mumbai</div> < div id= indiamap style= position: absolute; z-index: 1; left: 1; top: 1; visibility: visible ><img src= india.gif width= 280 height= 355 border= 0 usemap= #Map ></div> <map name= Map > 3 < area shape= circle coords= 114,97,12 onmouseover= Show( newdelhi ) onmouseout= Hide( newdelhi ) > 4 < area shape= circle coords= 62,211,12 onmouseover= Show( mumbai ) onmouseout= Hide( mumbai ) > </map> </body> </html> Hot spots 1 JavaScript code is inserted in a <script> tag in the head part of the html file. The function Show() searches in the document for an element with a certain id and sets the visibility of that element to visible. The function Hide() works in the same way to hide elements. 2 A <div> element is a layer. By giving that element an id-attribute, it can be addressed by scripting. The style-attributes are stylesheets and written in css-syntax. position: absolute; Sets the position of the layer. In this case, 58 px from the left and 100 px from the top. z-index: 2; Defi nes how layers are positioned over each other. The layer with the highest number is on the top.
5. JavaScript Basics
CHAPTER 5: JavaScript Basics 88 5. JavaScript Basics 5.1 An Introduction to JavaScript A Programming language for creating active user interface on Web pages JavaScript script is added in an HTML page,
More informationDynamic documents with JavaScript
Dynamic documents with JavaScript Introduction Informally, a dynamic XHTML document is an XHTML document that, in some way, can be changed while it is being displayed by a browser. Dynamic XHTML is not
More informationIntroduction to JavaScript
127 Lesson 14 Introduction to JavaScript Aim Objectives : To provide an introduction about JavaScript : To give an idea about, What is JavaScript? How to create a simple JavaScript? More about Java Script
More informationBy the end of this section of the practical, the students should be able to:
By the end of this section of the practical, the students should be able to: Write JavaScript to generate HTML Create simple scripts which include input and output statements, arithmetic, relational and
More informationIntroduction to DHTML
Introduction to DHTML HTML is based on thinking of a web page like a printed page: a document that is rendered once and that is static once rendered. The idea behind Dynamic HTML (DHTML), however, is to
More informationProduced by. App Development & Modeling. BSc in Applied Computing. Eamonn de Leastar
App Development & Modeling BSc in Applied Computing Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie
More informationWeb Programming/Scripting: JavaScript
CS 312 Internet Concepts Web Programming/Scripting: JavaScript Dr. Michele Weigle Department of Computer Science Old Dominion University mweigle@cs.odu.edu http://www.cs.odu.edu/~mweigle/cs312-f11/ 1 Outline!
More informationIntroduction to using HTML to design webpages
Introduction to using HTML to design webpages #HTML is the script that web pages are written in. It describes the content and structure of a web page so that a browser is able to interpret and render the
More informationPlace User-Defined Functions in the HEAD Section
JavaScript Functions Notes (Modified from: w3schools.com) A function is a block of code that will be executed when "someone" calls it. In JavaScript, we can define our own functions, called user-defined
More informationClient vs Server Scripting
Client vs Server Scripting PHP is a server side scripting method. Why might server side scripting not be a good idea? What is a solution? We could try having the user download scripts that run on their
More informationWhat is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script
What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages
More informationIntroduction to WEB PROGRAMMING
Introduction to WEB PROGRAMMING Web Languages: Overview HTML CSS JavaScript content structure look & feel transitions/animation s (CSS3) interaction animation server communication Full-Stack Web Frameworks
More informationWeb Engineering (Lecture 06) JavaScript part 2
Web Engineering (Lecture 06) JavaScript part 2 By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester JavaScript Events HTML events are "things" that happen to HTML elements. javascript lets you execute
More informationJavaScript s role on the Web
Chris Panayiotou JavaScript s role on the Web JavaScript Programming Language Developed by Netscape for use in Navigator Web Browsers Purpose make web pages (documents) more dynamic and interactive Change
More informationChapter 14. Dynamic HTML: Event Model
Chapter 14. Dynamic HTML: Event Model DHTML s event model lets scripts respond to user actions. Event onclick The onclick event fires when the user clicks the mouse. The following causes the enclosed script
More informationJavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK
Programming for Digital Media EE1707 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK 1 References and Sources 1. Javascript & JQuery: interactive front-end
More informationWeb Development & Design Foundations with HTML5
1 Web Development & Design Foundations with HTML5 CHAPTER 14 A BRIEF LOOK AT JAVASCRIPT Copyright Terry Felke-Morris 2 Learning Outcomes In this chapter, you will learn how to: Describe common uses of
More informationSession 16. JavaScript Part 1. Reading
Session 16 JavaScript Part 1 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript / p W3C www.w3.org/tr/rec-html40/interact/scripts.html Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/
More informationINFO 2450 Project 6 Web Site Resources and JavaScript Behaviors
INFO 2450 Project 6 Web Site Resources and JavaScript Behaviors Project 6 Objectives: Learn how to create graphical content with specified dimensions and formats for a Web site. Incorporate the site color
More informationNew Media Production Lecture 7 Javascript
New Media Production Lecture 7 Javascript Javascript Javascript and Java have almost nothing in common. Netscape developed a scripting language called LiveScript. When Sun developed Java, and wanted Netscape
More informationLesson 5: Introduction to Events
JavaScript 101 5-1 Lesson 5: Introduction to Events OBJECTIVES: In this lesson you will learn about Event driven programming Events and event handlers The onclick event handler for hyperlinks The onclick
More informationCS197WP. Intro to Web Programming. Nicolas Scarrci - February 13, 2017
CS197WP Intro to Web Programming Nicolas Scarrci - February 13, 2017 Additive Styles li { color: red; }.important { font-size: 2em; } first Item Second
More informationThe first sample. What is JavaScript?
Java Script Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. In this lecture
More informationChapter 7: JavaScript for Client-Side Content Behavior
Chapter 7: JavaScript for Client-Side Content Behavior Overview and Objectives Create a rotating sequence of images (a slide show ) on the home page for our website Use a JavaScript function as the value
More informationCOMS 359: Interactive Media
COMS 359: Interactive Media Agenda Review CSS Layout Preview Review Introducting CSS What is CSS? CSS Syntax Location of CSS The Cascade Box Model Box Structure Box Properties Review Style is cascading
More informationTo get multiple area selections add one or more id's to the areas rel attribute.
Mapper.js 2.4 allows you to add automatic area highlighting to image maps on your webpages (inc. export to SVG). It uses unobtrusive javascript to keep your code clean. It works in all the major browsers
More informationINDIAN SCHOOL DARSAIT FIRST TERM EXAM- MAY 2017 MULTIMEDIA AND WEB TECHNOLOGY (067) SAMPLE PAPER Class: XI Max.Marks: 70
INDIAN SCHOOL DARSAIT FIRST TERM EXAM- MAY 07 MULTIMEDIA AND WEB TECHNOLOGY (067) SAMPLE PAPER Class: XI Max.Marks: 70 Date: 6-09-07 Time: 3hr. Answer the following questions based on HTML. a) Differentiate
More informationIAT 355 : Lab 01. Web Basics
IAT 355 : Lab 01 Web Basics Overview HTML CSS Javascript HTML & Graphics HTML - the language for the content of a webpage a Web Page put css rules here
More informationLearning JavaScript. A C P K Siriwardhana, BSc, MSc
Learning JavaScript A C P K Siriwardhana, BSc, MSc Condition Statements If statements loop statements switch statement IF THEN ELSE If something is true, take a specified action. If false, take some other
More informationJavaScript I.b CSCI311
JavaScript I.b CSCI311 Learning Objectives Learn basic JavaScript control and data structures arrays objects loops JavaScript used for user events and reactions compute values and display results change
More informationAs we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.
Extra notes - Client-side Design and Development Dr Nick Hayward HTML - Basics A brief introduction to some of the basics of HTML. Contents Intro element add some metadata define a base address
More informationCreate a cool image gallery using CSS visibility and positioning property
GRC 275 A8 Create a cool image gallery using CSS visibility and positioning property 1. Create a cool image gallery, having thumbnails which when moused over display larger images 2. Gallery must provide
More informationMouse-over Effects. Text based buttons
Mouse-over Effects Text based buttons Mouse-over Effects: Text based buttons. The purpose of this pamphlet is to give you a simple and quick example that illustrates the use of text based mouse-over effects
More informationThen there are methods ; each method describes an action that can be done to (or with) the object.
When the browser loads a page, it stores it in an electronic form that programmers can then access through something known as an interface. The interface is a little like a predefined set of questions
More informationPrincess Nourah bint Abdulrahman University. Computer Sciences Department
Princess Nourah bint Abdulrahman University 1 And use http://www.w3schools.com/ JavaScript Objectives Introduction to JavaScript Objects Data Variables Operators Types Functions Events 4 Why Study JavaScript?
More informationLecture 14. Introduction to JavaScript. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)
Lecture 14 Introduction to JavaScript Mr. Mubashir Ali Lecturer (Dept. of dr.mubashirali1@gmail.com 1 Outline What is JavaScript? Embedding JavaScript with HTML JavaScript conventions Variables in JavaScript
More informationJavaScript is described in detail in many books on the subject, and there is excellent tutorial material at
JavaScript (last updated April 15, 2013: LSS) JavaScript is a scripting language, specifically for use on web pages. It runs within the browser (that is to say, it is a client- side scripting language),
More information1) Introduction to HTML
1) Introduction to HTML a) Two ways to Create a webpage (Hyper- Text Document): i) WYSIWYG: What You See Is What You Get: Drag- n- Drop tools like Microsoft Word and Adobe Dreamweaver i) Markup Language:
More informationHTML: Fragments, Frames, and Forms. Overview
HTML: Fragments, Frames, and Forms Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@ imap.pitt.edu http://www.sis. pitt.edu/~spring Overview Fragment
More informationJavaScript Introduction
JavaScript Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. What is JavaScript?
More informationUnit 20 - Client Side Customisation of Web Pages. Week 4 Lesson 5 Fundamentals of Scripting
Unit 20 - Client Side Customisation of Web Pages Week 4 Lesson 5 Fundamentals of Scripting The story so far... three methods of writing CSS: In-line Embedded }These are sometimes called External } block
More informationCOMP 101 Spring 2017 Final Exam Section 1 Friday, May 5
Name PID COMP 101 Spring 2017 Final Exam Section 1 Friday, May 5 This exam is open note, open book and open computer. It is not open people. You are welcome and encouraged to use all of the resources that
More informationEvents: another simple example
Internet t Software Technologies Dynamic HTML part two IMCNE A.A. 2008/09 Gabriele Cecchetti Events: another simple example Every element on a web page has certain events which can trigger JavaScript functions.
More informationITS331 Information Technology I Laboratory
ITS331 Information Technology I Laboratory Laboratory #11 Javascript and JQuery Javascript Javascript is a scripting language implemented as a part of most major web browsers. It directly runs on the client's
More informationEXERCISE: Introduction to client side JavaScript
EXERCISE: Introduction to client side JavaScript Barend Köbben Version 1.3 March 23, 2015 Contents 1 Dynamic HTML and scripting 3 2 The scripting language JavaScript 3 3 Using Javascript in a web page
More informationPrograming for Digital Media EE1707. Lecture 4 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK
Programing for Digital Media EE1707 Lecture 4 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK 1 today Event Handling in JavaScript Client-Side JavaScript
More informationQ1. What is JavaScript?
Q1. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded
More informationSession 6. JavaScript Part 1. Reading
Session 6 JavaScript Part 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/ JavaScript Debugging www.w3schools.com/js/js_debugging.asp
More information1$ 5 ! $ 6 4 * Source: 0 "!*! 0! * 8 97 ?!$ 5 0 *! 4! $ 0 : * ' () 7;7 7<7
!#! # %! ' ()!* +, -.!/ *! * 1 !!
More informationLesson 6: Introduction to Functions
JavaScript 101 6-1 Lesson 6: Introduction to Functions OBJECTIVES: In this lesson you will learn about Functions Why functions are useful How to declare a function How to use a function Why functions are
More informationPositioning in CSS: There are 5 different ways we can set our position:
Positioning in CSS: So you know now how to change the color and style of the elements on your webpage but how do we get them exactly where we want them to be placed? There are 5 different ways we can set
More informationUsing Dreamweaver CS6
Using Dreamweaver CS6 7 Dynamic HTML Dynamic HTML (DHTML) is a term that refers to website that use a combination of HTML, scripting such as JavaScript, CSS and the Document Object Model (DOM). HTML and
More informationJavascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010
Lecture 22 Javascript Announcements Homework#7 now due 11/24 at noon Reminder: beginning with Homework #7, Javascript assignments must be submitted using a format described in an attachment to HW#7 I will
More informationCE212 Web Application Programming Part 2
CE212 Web Application Programming Part 2 22/01/2018 CE212 Part 2 1 JavaScript Event-Handlers 1 JavaScript may be invoked to handle input events on HTML pages, e.g.
More informationChapter 16. JavaScript 3: Functions Table of Contents
Chapter 16. JavaScript 3: Functions Table of Contents Objectives... 2 14.1 Introduction... 2 14.1.1 Introduction to JavaScript Functions... 2 14.1.2 Uses of Functions... 2 14.2 Using Functions... 2 14.2.1
More informationWeb Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh
Web Programming and Design MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh Plan for the next 5 weeks: Introduction to HTML tags, creating our template file Introduction to CSS and style
More informationPIC 40A. Midterm 1 Review
PIC 40A Midterm 1 Review XHTML and HTML5 Know the structure of an XHTML/HTML5 document (head, body) and what goes in each section. Understand meta tags and be able to give an example of a meta tags. Know
More information* HTML BASICS * LINKING BY: RIHAM ALSMARI, PNU. Lab 2
* HTML BASICS * LINKING BY: RIHAM ALSMARI, PNU Lab 2 What is the output of the following HTML code? HTML Element Attributes.. Using Element Attributes 4 HTML elements can have attributes Attributes provide
More information<form>. input elements. </form>
CS 183 4/8/2010 A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, text area fields, drop-down menus, radio buttons,
More informationAn Brief Introduction to a web browser's Document Object Model (DOM) Lecture 24
An Brief Introduction to a web browser's Document Object Model (DOM) Lecture 24 Midterm 1 Scores Review Sessions Go Over Midterm 1 Didn't feel like the midterm went well? Had questions? Come review the
More informationChapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL
Chapter4: HTML Table and Script page, HTML5 new forms Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL Objective To know HTML5 creating a new style form. To understand HTML table benefits
More informationJust add an HTML comment tag <!-- before the first JavaScript statement, and an end-of comment tag --> after the last JavaScript statement, like this:
JavaScript Basic JavaScript How To and Where To JavaScript Statements and Comments JavaScript Variables JavaScript Operators JavaScript Comparisons JavaScript If Else JavaScript Loops JavaScript Flow Control
More informationJavaScript CSCI 201 Principles of Software Development
JavaScript CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline JavaScript Program USC CSCI 201L JavaScript JavaScript is a front-end interpreted language that
More informationHtml basics Course Outline
Html basics Course Outline Description Learn the essential skills you will need to create your web pages with HTML. Topics include: adding text any hyperlinks, images and backgrounds, lists, tables, and
More informationc122sep2914.notebook September 29, 2014
Have done all at the top of the page. Now we will move on to mapping, forms and iframes. 1 Here I am setting up an image and telling the image to uuse the map. Note that the map has name="theimage". I
More informationHTML5 and CSS3--Images Page 1
HTML5 and CSS3--Images Page 1 1 HTML5 and CSS3 IMAGES 2 3 4 5 6 Images in HTML Since HTML is text, images are not inserted into the HTML document using the tag Different image types used on the Web:.jpg
More informationProgrammazione Web a.a. 2017/2018 HTML5
Programmazione Web a.a. 2017/2018 HTML5 PhD Ing.Antonino Raucea antonino.raucea@dieei.unict.it 1 Introduzione HTML HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text
More information1. Cascading Style Sheet and JavaScript
1. Cascading Style Sheet and JavaScript Cascading Style Sheet or CSS allows you to specify styles for visual element of the website. Styles specify the appearance of particular page element on the screen.
More informationCOMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)
COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,
More informationJQUERYUI - TOOLTIP. content This option represents content of a tooltip. By default its value is function returning the title attribute.
JQUERYUI - TOOLTIP http://www.tutorialspoint.com/jqueryui/jqueryui_tooltip.htm Copyright tutorialspoint.com Tooltip widget of jqueryui replaces the native tooltips. This widget adds new themes and allows
More informationPage Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning
Page Layout contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning 2 1 4.1
More informationElementary Computing CSC 100. M. Cheng, Computer Science
Elementary Computing CSC 100 1 Basic Programming Concepts A computer is a kind of universal machine. By using different software, a computer can do different things. A program is a sequence of instructions
More informationComputer Programming. Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering IIT Bombay
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering Session: Lists, Links, and Images in HTML Recap Introduced HTML Examined some basic tags
More informationDynamism and Detection
1 Dynamism and Detection c h a p t e r ch01 Page 1 Wednesday, June 23, 1999 2:52 PM IN THIS CHAPTER Project I: Generating Platform-Specific Content Project II: Printing Copyright Information and Last-Modified
More informationConfiguring Hotspots
CHAPTER 12 Hotspots on the Cisco NAC Guest Server are used to allow administrators to create their own portal pages and host them on the Cisco NAC Guest Server. Hotspots created by administrators can be
More informationWeb Programming HTML CSS JavaScript Step by step Exercises Hans-Petter Halvorsen
https://www.halvorsen.blog Web Programming HTML CSS JavaScript Step by step Exercises Hans-Petter Halvorsen History of the Web Internet (1960s) World Wide Web - WWW (1991) First Web Browser - Netscape,
More informationProject 3 Web Security Part 1. Outline
Project 3 Web Security Part 1 CS155 Indrajit Indy Khare Outline Quick Overview of the Technologies HTML (and a bit of CSS) Javascript PHP Assignment Assignment Overview Example Attack 1 New to web programming?
More informationCSC309 Winter Lecture 2. Larry Zhang
CSC309 Winter 2016 Lecture 2 Larry Zhang 1 Announcements Assignment 1 is out, due Jan 25, 10pm. Start Early! Work in groups of 2, make groups on MarkUs. Make sure you can login to MarkUs, if not let me
More informationCISH-6510 Web Application Design and Development. Overview of JavaScript. Overview
CISH-6510 Web Application Design and Development Overview of JavaScript Overview What is JavaScript? History Uses of JavaScript Location of Code Simple Alert Example Events Events Example Color Example
More informationINTRODUCTION TO JAVASCRIPT
INTRODUCTION TO JAVASCRIPT Overview This course is designed to accommodate website designers who have some experience in building web pages. Lessons familiarize students with the ins and outs of basic
More informationWeb Development. With PHP. Web Development With PHP
Web Development With PHP Web Development With PHP We deliver all our courses as Corporate Training as well if you are a group interested in the course, this option may be more advantageous for you. 8983002500/8149046285
More informationMAX 2006 Beyond Boundaries
Building a Spry Page MAX 2006 Beyond Boundaries Donald Booth Dreamweaver QE/Spry Team Adobe Systems, Inc. 1. Attach CSS/JS 1. Browse to the Assets folder and attach max.css. 2. Attach the 2 js files.
More informationBOOTSTRAP TOOLTIP PLUGIN
BOOTSTRAP TOOLTIP PLUGIN http://www.tutorialspoint.com/bootstrap/bootstrap_tooltip_plugin.htm Copyright tutorialspoint.com Tooltips are useful when you need to describe a link. The plugin was inspired
More informationUsing JavaScript in a compatible way
Draft: javascript20020518.wpd Printed on May 18, 2002 (3:24pm) Using JavaScript in a compatible way Rafael Palacios* *Universidad Pontificia Comillas, Madrid, Spain Abstract Many web pages use JavaScript
More informationHTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS
MOST TAGS CLASS Divides tags into groups for applying styles 202 ID Identifies a specific tag 201 STYLE Applies a style locally 200 TITLE Adds tool tips to elements 181 Identifies the HTML version
More informationAn Brief Introduction to a web browser's Document Object Model (DOM) Lecture 20 COMP110 Spring 2018
An Brief Introduction to a web browser's Document Object Model (DOM) Lecture 20 COMP110 Spring 2018 Final Exams We will split up across this room and another. I will let you know when your assigned building
More information«FitPhoto» Integration
«FitPhoto» Integration Version 4.3 EN Date 21/08/2012 Company FittingBox 2010 FittingBox Reserved 1 / 20 Table of contents 1. Basic Setup... 3 2. Loading FitPhoto... 4 2.1. Synchronous integration (Recommended)...
More informationCMPSCI 120 Fall 2015 Midterm Exam #2 Solution Key Monday, November 16, 2015 Professor William T. Verts
CMPSCI 120 Fall 2015 Midterm Exam #2 Solution Key Monday, November 16, 2015 Professor William T. Verts Page 1 of 6 20 Points Quick Answers. Do any 10 for full credit (2 points each); do more for extra
More informationControlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.
Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible
More informationIndex. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148
Index Numbers & Symbols (angle brackets), in HTML, 47 : (colon), in CSS, 96 {} (curly brackets), in CSS, 75, 96. (dot), in CSS, 89, 102 # (hash mark), in CSS, 87 88, 99 % (percent) font size, in CSS,
More informationIT430- E-COMMERCE Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan Arshad
IT430- E-COMMERCE Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan Arshad OCT 21,2016 BS110401050 BS110401050@vu.edu.pk Arslan.arshad01@gmail.com AKMP01 IT430 - E-COMMERCE Midterm Papers
More informationREADSPEAKER ENTERPRISE HIGHLIGHTING 2.5
READSPEAKER ENTERPRISE HIGHLIGHTING 2.5 Advanced Skinning Guide Introduction The graphical user interface of ReadSpeaker Enterprise Highlighting is built with standard web technologies, Hypertext Markup
More informationModules Documentation ADMAN. Phaistos Networks
Modules Documentation ADMAN Phaistos Networks Table of Contents TABLE OF CONTENTS... 2 KEYWORDS... 5 FLASH BANNERS... 6 Options... 6 Public methods... 6 Public events... 6 Example... 7 EXPANDING BANNERS...
More informationCPSC 481: CREATIVE INQUIRY TO WSBF
CPSC 481: CREATIVE INQUIRY TO WSBF J. Yates Monteith, Fall 2013 Schedule HTML and CSS PHP HTML Hypertext Markup Language Markup Language. Does not execute any computation. Marks up text. Decorates it.
More informationJavascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010
Lecture 21 Javascript Announcements Reminder: beginning with Homework #7, Javascript assignments must be submitted using a format described in an attachment to HW#7 3rd Exam date set for 12/14 in Goessmann
More informationCSS Cascading Style Sheets
CSS Cascading Style Sheets site root index.html about.html services.html stylesheet.css images boris.jpg Types of CSS External Internal Inline External CSS An external style sheet is a text document with
More informationData Visualization (CIS 468)
Data Visualization (CIS 468) Web Programming Dr. David Koop Languages of the Web HTML CSS SVG JavaScript - Versions of Javascript: ES6/ES2015, ES2017 - Specific frameworks: react, jquery, bootstrap, D3
More informationWelcome Please sit on alternating rows. powered by lucid & no.dots.nl/student
Welcome Please sit on alternating rows powered by lucid & no.dots.nl/student HTML && CSS Workshop Day Day two, November January 276 powered by lucid & no.dots.nl/student About the Workshop Day two: CSS
More informationPES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II
PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore 560 100 WEB PROGRAMMING Solution Set II Section A 1. This function evaluates a string as javascript statement or expression
More information