Pertemuan 10 JavaScript.

Slides:



Advertisements
Similar presentations
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Advertisements

JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
HTML FORMATTING. CONTENTS HTML Formatting Formatting Example Formatting Example Output Summary Exercise.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 12 - JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object.
MORE HTML REMEMBER TO SEARCH W3 SCHOOLS FOR MORE INFO.
Define html document byusing Example : Title of the document The content of the document......
Headings, Paragraphs, Formatting, Links, Head, CSS, Images
2 Alerts and the If/Else Conditional Statement CONTINUED There's No Right Way to Do It There are, literally, a million ways to write any given script.
Word Processing. Word Processing and the WWW Differences –WWW is dynamic Variable window size Possibly non-graphical devices Leave decisions to the browser.
Scripting Languages.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 03 - Spring 2011.
Continuing HTML. Hyperlinks There are two types of hyperlinks, one that keeps the viewer within the webpage, the other that takes the viewer outside to.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
1 JavaScript: Objects and Object Models October 25, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel,
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
HTML Basic I IST2101. Keep In Mind Programming can be time consuming. Plan ahead!
String Object.  Conundrum: I would like people to have more time on the revisions…  … but I don't have a lot of time myself for more grading  A1 Revision.
JavaScript For...In Statement The for...in statement loops through the elements of an array or through the properties of an object. Syntax for (variable.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
HTML Basic IST2101. Keep In Mind Programming can be time consuming. Plan ahead!
Objects.  Java Script is an OOP Language  So it allows you to make your own objects and make your own variable types  I will not be going over how.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
CS346 Javascript -3 Module 3 JavaScript Variables.
JavaScript, Part 2 Instructor: Charles Moen CSCI/CINF 4230.
1 JavaScript
10 – Java Script (3) Informatics Department Parahyangan Catholic University.
Introduction To JavaScript. Putting it Together (page 11) All javascript must go in-between the script tags. All javascript must go in-between the script.
1 Server versus Client-Side Programming Server-SideClient-Side.
HTML BASIC IST 210: Organization of Data IST210 1.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming strings.
Chapter 14 JavaScript: Part II The Web Warrior Guide to Web Design Technologies.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
HTML. INDEX Introduction to HTML Creating Web Pages Commands And Tags Web Page.
OVERVIEW OF CLIENT-SIDE SCRIPTING
Javascript| SCK3633 Web Programming | Jumail, FSKSM, UTM, 2006 | Last Updated January 2006 Slide 1 Javascript Lecture 4 Lecture 4: Javascript| SCK3633.
Ch. 2. HTML 1. HTML? 2  Tim Berner-Lee first proposed (1981) and coded (1991)  HTML: HyperText Markup Language  Web browser 용  W3C (World Wide Web.
Week-11 (Lecture-1) Introduction to HTML programming: A web based markup language for web. Ex.
HTML Basic IST 210: Organization of Data IST2101.
Chapter 13: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
Chapter 4 Java Script – Part2. 2 Location object Properties Properties href – whole path will be displayed. ex: window.location.href ( see example 11)
Java Script: Objects (Chapter 12 in [2]). 2 Outline Introduction Introduction Thinking About Objects Thinking About Objects Math Object Math Object String.
Hello Educational presentation.
Java Script Date Object
JavaScript.
Build in Objects In JavaScript, almost "everything" is an object.
TinyMCE Editor.
Pertemuan 7 JavaScript.
ISC440: Web Programming 2 Web Programming Revision
Exploring JavaScript Ch 14
Introduction to HTML.
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
JavaScript Objects.
JavaScript an introduction.
Chapter 12 - JavaScript: Objects
String, Math & Miscellaneous Methods & Properties
Pertemuan 11 JavaScript.
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
Chapter 12 - JavaScript: Objects
Lect2 (MCS/BCS) Javascript.
Embedded PHP in HTML 5 & Strings in PHP
JavaScript Strings and Arrays
Pertemuan 13 JavaScript.
Pertemuan 10 JavaScript.
Tutorial 10: Programming with javascript
Chapter 12 - JavaScript: Objects
The <script> Tag
Programming Basics Review
String, Math & Miscellaneous Methods & Properties
Pertemuan 12 JavaScript.
What We Want To Do User enters: Mary Smith
Presentation transcript:

Pertemuan 10 JavaScript

String Object Return the length of a string Style String The index of() method The match() method Replace Characters in string – replace()

Return the length of a string <html> <body> <script type="text/javascript"> var txt="Hello World!"; document.write(txt.length); </script> </body> </html> 12

Style String Big: Hello World! Small: Hello World! Bold: Hello World! <html> <body> <script type="text/javascript"> var txt="Hello World!"; document.write("<p>Big: " + txt.big() + "</p>"); document.write("<p>Small: " + txt.small() + "</p>"); document.write("<p>Bold: " + txt.bold() + "</p>"); document.write("<p>Italic: " + txt.italics() + "</p>"); document.write("<p>Blink: " + txt.blink() + " (does not work in IE)</p>"); document.write("<p>Fixed: " + txt.fixed() + "</p>"); document.write("<p>Strike: " + txt.strike() + "</p>"); document.write("<p>Fontcolor: " + txt.fontcolor("Red") + "</p>"); document.write("<p>Fontsize: " + txt.fontsize(16) + "</p>"); document.write("<p>Lowercase: " + txt.toLowerCase() + "</p>"); document.write("<p>Uppercase: " + txt.toUpperCase() + "</p>"); document.write("<p>Subscript: " + txt.sub() + "</p>"); document.write("<p>Superscript: " + txt.sup() + "</p>"); document.write("<p>Link: " + txt.link("http://www.w3schools.com") + "</p>"); </script> </body> </html> Big: Hello World! Small: Hello World! Bold: Hello World! Italic: Hello World! Blink: Hello World! (does not work in IE) Fixed: Hello World! Strike: Hello World! Fontcolor: Hello World! Fontsize: Hello World! Lowercase: hello world! Uppercase: HELLO WORLD! Subscript: Hello World! Superscript: Hello World! Link: Hello World!

The index of() method <html> <body> <script type="text/javascript"> var str="Hello world!"; document.write(str.indexOf("Hello") + "<br />"); document.write(str.indexOf("World") + "<br />"); document.write(str.indexOf("world")); </script> </body> </html> 0 -1 6

The match() method <html> <body> <script type="text/javascript"> var str="Hello world!"; document.write(str.match("world") + "<br />"); document.write(str.match("World") + "<br />"); document.write(str.match("worlld") + "<br />"); document.write(str.match("world!")); </script> </body> </html> world null null world!

Replace Characters in string – replace() <html> <body> <script type="text/javascript"> var str="Visit Microsoft!"; document.write(str.replace(/Microsoft/,"W3Schools")); </script> </body> </html> Visit W3Schools!

Tugas