Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,453 members, 7,836,804 topics. Date: Wednesday, 22 May 2024 at 12:52 PM

Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] - Webmasters (2) - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] (3366 Views)

Object Oriented Programing And Procedural Programing In Php What Is The Diff? / Procedural Vs Object Oriented PHP / How To Implement Captcha(made Simple On Procedural Php) (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 11:11pm On Jun 11, 2009
alright sir !
i only have an Idea
lets say Object name is DHTML
with Properties like , fingers, Skills(thou abstract and intelligently driven grin) and his eyes which object DHTML has,
now , methods are
type() using his fingers to type---- property of object used ;
see() usng eyes to monitor what he is typing is also among ;
teach() and his skill way hin dey deliver are methods this Objects uses;

and, events of object DHTML are :
onSeelaptop()//when hin see laptop , he always like to dey press am
whileTyping()// while typing , hin dey always look the screean and hin fingers dey always drive ontop the keyboard
onThinking()// he use to fetch array of thinks he know for head tongue
onVisitingNiaraLand() //when he visits nairaland he always want us to feel him
and many more
i hope i pass the assignment , i want teacher to post my score here , other students can also post them assignment here
let the class go on pls
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 6:13am On Jun 12, 2009
Outstanding segsalert, i will score you a 70% using the close marking system, that says u cant get less than 30% or higher than 70%

So we now move on to the windows object.

Window Object
The windows object represent the browser window. You can use it to access all the other objects in the browser.

You can use the window object to retrieve information about the state of the window. You also can use this object to gain access to the document in the window, to the events that occur in the window, and to features of the browser that affect the window.

Typically, the browser creates one window object when it opens an HTML document. However, if a document defines one or more frames (that is, contains one or more FRAME or IFRAME tags), the browser creates one window object for the original document and one additional window object for each frame. These additional objects are child windows of the original window and can be affected by actions that occur in the original. For example, closing the original window causes all child windows to close. You can also create new windows (and corresponding window objects) using methods such as open, showModalDialog, and showModelessDialog.

You can apply any window property, method, or collection to any variable or expression that evaluates to a window object, regardless of how that window was created. Additionally, you can access all window properties, methods, and collections in the current window by using the property, method, or collection name directly—that is, without prefixing it with an expression that evaluates to the current window object. However, to help make more readable code and to avoid potential ambiguities, many authors use the window keyword when accessing window properties, methods, and collections for the current window. This keyword always refers to the current window.

Note: Window property, method, and collection names are reserved keywords and cannot be used as the names of variables and routines.

The dialogArguments, dialogHeight, dialogLeft, dialogTop, dialogWidth, and returnValue properties are available only for windows created using the showModalDialog and showModelessDialog methods.


Properties:
clipboardData: Provides access to predefined clipboard formats for use in editing operations.
closed: Retrieves whether the referenced window is closed.
defaultStatus: Sets or retrieves the default message displayed in the status bar at the bottom of the window.
dialogArguments: Retrieves the variable or array of variables passed into the modal dialog window.
dialogHeight: Sets or retrieves the height of the modal dialog window.
dialogLeft: Sets or retrieves the left coordinate of the modal dialog window.
dialogTop: Sets or retrieves the top coordinate of the modal dialog window.
dialogWidth: Sets or retrieves the width of the modal dialog window.
document: Represents the HTML document in a given browser window.
event: Represents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons.
external: Allows access to an additional object model provided by host applications of the Microsoft® Internet Explorer browser components.
history: Contains information about the URLs visited by the client.
length: Retrieves the number of objects in a collection.
location: Contains information about the current URL.
name: Sets or retrieves the window or frame name.
navigator: Contains information about the Web browser.
offscreenBuffering: Sets or retrieves whether objects are drawn offscreen before being made visible to the user.
opener: Sets or retrieves a reference to the window that created the current window.
parent: Retrieves the parent of the window in the object hierarchy.
returnValue Sets or retrieves the return value from the modal dialog window.
screen: Contains information about the client's screen and rendering capabilities.
screenLeft: Retrieves the x-coordinate of the upper left-hand corner of the browser's client area, relative to the upper left-hand corner of the screen.
screenTop: Retrieves the y-coordinate of the top corner of the browser's client area, relative to the top corner of the screen.
self: Retrieves a reference to the current window or frame.
status: Sets or retrieves the message in the status bar at the bottom of the window.
top: Retrieves the topmost ancestor window, which is its own parent.


Example:


This example displays an alert for the current window.

alert("A simple message."wink

This example checks whether the current window contains child windows and, if it does, displays the names of those child windows.

if ( window.frames != null ) {
for ( i = 0; i< window.frames.length; i++ )
window.alert ("Child window " +i+ " is named "+window.frames(i).name);
}

This example shows a simple event handler function for the window's onload event. In the absence of a "window" element, the BODY element hosts the following window object events: onblur, onbeforeunload, onfocus, onload, and onunload.

<BODY onload="window.status='Page is loaded!'">

. . . see you in the next class . . .
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 9:15am On Jun 12, 2009
Uhmm 70% ke?
well, i will try to score higher in the next assignment
Good, class is moving on now \
am still following the class, still not that complex yet for me to chew , so, no question yet
Thanks for helping we newbiees oo
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 8:49pm On Jun 12, 2009
There is a DHTML course material i will want however is interested in to have. . .it covers javascript and dhtml
To have it, send me an email (please click on my profile to see my email adr) with subject: dhtml material
It is especially useful towards this javascript tutorial. . .
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 2:13pm On Jun 13, 2009
Do not bother to bomb my email again, just download the materials from here directly:

Course Reference Material Downloads

DHTML Reference

Javascript Reference

Despite the fact that the materials talk mainly about microsoft internet explorer, alot of the sam stuffs apply to other browsers. . .
Just download those materials so that my tutorial will expantiate on the important areas, i will keep supplyin the relevant stuffs
as we go on. . .
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 4:18pm On Jun 13, 2009
i have downloaded it sir ,
gonna look it up asap
Thanks sir
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 4:24pm On Jun 13, 2009
No problemo, just look it up, i am battling with some codes offline at the moment, i will continue posting later.
Meanwhile, the materials i gave out are reference materials and not really tutorials per se, but you can pick some skills
from them on areas of dhtml such as html, css and javascript, excluding some other areas such as DOM, XML, PHP, MySQL. . .
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 4:28pm On Jun 13, 2009
those materials no get author?
why you no put your name?
ouch ,
i just dey know say you surpose dey work woth Longman / Lantern
make you start writting up books ooo
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 5:35pm On Jun 13, 2009
Author, it is only that learn html 2009 that i have written. . . .i hate repeating what others have already done, there
are uncountable books online and everywhere. . . .i can only pick out some and share my experiences. . .maybe i can
write some books later. . .those reference materials were not made by me, so i cannot put my name there. . .
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 9:40pm On Jun 13, 2009
applause,
as i glance thru those materials i know ,
just wanna show people why i love you just like myself kiss
you no dey decieve , no dey lie and you dey Sincere always
abeg , let the class go on !
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by segsalerty(m): 8:11pm On Jun 15, 2009
yes, downloaded grin
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 10:01am On Jun 17, 2009
I forgot i even created this ajax thread, anyways tutorial continues shortly.
Re: Javascript Tutorial For Newbies [both Procedural / Oop Inclusive] by Nobody: 9:00pm On Jun 19, 2009
Windows Object | Methods:

alert:  Displays a dialog box containing an application-defined message.
attachEvent:  Binds the specified function to an event that fires on the window object when the function is called.
blur:  Causes an object to lose focus, and fires the onblur event.
clearInterval:  Cancels the interval previously started using the setInterval method.
clearTimeout:  Cancels a time-out that was set with the setTimeout method.
close  Closes the current browser window or HTML Application (HTA).
confirm:  Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons.
focus:  Causes a control to receive the focus, and executes the code specified by the onfocus event.
moveBy:  Moves the screen position of the window by the specified x- and y-offset values.
moveTo:  Moves the screen position of the upper-left corner of the window to the specified iX and iY position.
navigate:  Loads the specified URL to the current window.
open:  Opens a new window and loads the document specified by a given URL, or opens a blank document if a URL is not provided.
print:  Prints the document associated with the window.
prompt:  Displays a dialog box that prompts the user with a message and an input field.

For example, you can say:
<script>
var s=prompt("What is your name?","Tony"wink;
alert(s);
</script>

The windows object is the only one i am going to talk so much about, the others will be brief, then we do some
short exercises to practice what we have learnt so far.

(1) (2) (Reply)

Personal Domain Names and Websites / Mark Zuckerberg: Facebook Will End On January 15th, 2013! / 10 Great Advice For Bloggers Who Want To Be Successful

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.