1.All students if you want to all programming language download here Introduction to programming Computer programming is the process of designing and writing computer programs . As a skill set, it includes a wide variety of different tasks and techniques, but our tutorials are not intended to teach you everything. Instead, they are meant to provide basic, practical skills to help you understand and write computer code that reflects things you see and use in the real world. What you need to know Our computer programming tutorials assume that you have no programming experience whatsoever. They do, however, require basic familiarity with the use of computers and web browsers. For example, you should be comfortable downloading and opening files, and using text editing software. If you don't feel confid...
JAVASCRIPT DOWNLOAD NOTES BELLOW
Why use client-side programming?
Any server side programming language allows us to
create dynamic web pages. Why also use client-side
scripting?
¨ client-side scripting (JavaScript) benefits:
¤ usability: can modify a page without having to post
back to the server (faster UI)
¤ efficiency: can make small, quick changes to page
without waiting for server
¤ event-driven: can respond to user actions like clicks and
key presses
What is Javascript?
¨ a lightweight programming language ("scripting
language")
¤ used to make web pages interactive
¤ insert dynamic text into HTML (ex: a date)
¤ react to events (ex: user clicks on a button)
¤ get information about a user's computer (ex: browser
type)
¤ perform calculations on user's computer (ex: form
validation)
¨ a web standard (but not supported identically by
all browsers)
¨ NOT related to Java other than by name and some
syntactic similarities
Linking to a JavaScript file: script
¨ script tag should be placed in HTML page's head
¨ script code is stored in a separate .js file
¨ JS code can be placed directly in the HTML file's
body or head (like CSS)
¤ but this is bad style (should separate content,
presentation, and behavior)
Event-driven programming
¨ you are used to programs that start with a main
method (or implicit main like in PHP)
¨ JavaScript programs instead wait for user actions
called events and respond to them
¨ event-driven programming: writing programs driven
by user events
¨ Let's write a page with a clickable button that pops
up a "Hello, World" window...
The window object
¨ the entire browser window (DOM top-level object)
¨ technically, all global code and variables become
part of the window object properties:
¤ document, history, location, name
¨ methods:
¤ alert, confirm, prompt (popup boxes)
¤ setInterval, setTimeout clearInterval,
clearTimeout (timers)
¤ open, close (popping up new browser windows)
¤ blur, focus, moveBy, moveTo, print, resizeBy,
resizeTo, scrollBy, scrollTo
The document object (details soon)
¨ the current web page and the elements inside it
¨ properties:
¤ anchors, body, cookie, domain, forms,
images, links, referrer, title, URL
¨ methods:
¤ getElementById
¤ getElementsByName
¤ getElementsByTagName
¤ close, open, write, writeln
The location object
¨ the URL of the current web page
¨ properties:
¤ host, hostname, href, pathname, port,
protocol, search
¨ methods:
¤ assign, reload, replace
Unobtrusive JavaScript
¨ JavaScript event code seen previously was
obtrusive, in the HTML; this is bad style
¨ now we'll see how to write unobtrusive JavaScript
code
¤ HTML with minimal JavaScript inside
¤ uses the DOM to attach and execute all JavaScript
functions¨ allows separation of web site functionality into:
¤ content (HTML) - what is it?
¤ presentation (CSS) - how does it look?
¤ behavior (JavaScript) - how does it respond to user
interaction?
Comments
Post a Comment
WHICH PROGRAMMING LANGUAGE IF YOU WANT COMMENTS HERE I WILL BE SEND