Learn Java
JavaScript Array Object Methods – Part II
JavaScript Array Object Methods – Part II In this JavaScript tutorial, you will learn about on array object methods – slice(), splice() toString(), shift() and unshift() methods along with general syntax and examples. slice(): By using the methods of the array object the programmer is able to retrieve the first and the last elements in an array object. Suppose a programmer wishes to retrieve selected elements from an existing array. This can be performed by using the slice() method of the array object. The slice method creates a new array with the selected elements. General syntax of the slice() method…
JavaScript Array Object Methods – Part I
JavaScript Array Object Methods – Part I In this JavaScript tutorial, you will learn about Array Object Methods – concat(), join(), pop(), push() and reverse() methods along with general syntax and examples. concat() The concat() method is used to join two or more Array objects together to produce a new one. In the concat() method, the original Array objects are unaffected by this method and only a copy of the new concatenated array is returned. General syntax of the concat() method of the Array object of JavaScript: arrayObject.concat(arrayname1,arrayname2,……,arraynamen) An example to understand this concept in detail: <html> <body> <script…
JavaScript Window Object Open Method
JavaScript Window Object Open Method In this JavaScript tutorial, you will learn about JavaScript Window Object Open Method, features of window object open method – channelmode, directories, dependent, fullscreen, screenX, screenY, height, left, location, menubar, resizable, alwaysLowered, alwaysRaised channelmode: Syntax: channelmode=yes|no|1|0 The channelmode is used to denote whether the user wants to display the window in theater mode or not. The default setting of this feature is NO. The user can set channelmode value to YES which would then display the window in theater mode. This is a very important feature of Window Object of JavaScript . directories: Syntax: directories=yes|no|1|0…
JavaScript Window Object Open Method Part 2
JavaScript Window Object Open Method Part 2 In this JavaScript tutorial, you will learn about JavaScript Window Object Open Method, features of window object open method – scrollbars, status, titlebar, toolbar, top, width, innerHeight, innerWidth, outerHeight, outerWidth and hotkeys scrollbars: Syntax: scrollbars=yes|no|1|0 The scrollbar feature denotes whether or not the scroll bars should be displayed. The default value of the scrollbars feature is YES, displaying the scroll bars. If the value of the scrollbars feature is set to NO by the user, then the scroll bars are not displayed. status: Syntax: status=yes|no|1|0 This allows the user the provision of adding…
JavaScript Location Object
JavaScript Location Object In this JavaScript tutorial, you will learn about JavaScript Location Object – assign(), reload(), replace(), JavaScript Window Object Methods viz alert(), blur(), setInterval() and clearInterval().Methods of Location Object assign(): The assign method of location object is used for loading a new document. General syntax of assign method of location Object: location.assign(URL) for example <html> <head> <script type="text/javascript"> function test() { window.location.assign("http://www.exforsys.com") } </script> </head> <body> <input type="button" value="Click Here For Loading New Document" onclick="test()" /> </body> </html> The output of the above program is a…
JavaScript DOM Window Object
JavaScript DOM Window Object In this JavaScript tutorial, you will learn about closed property and name property, defaultStatus, status, self property of JavaScript Window object closed Property of Window Object: The closed property of a Window object returns a Boolean variable denoting whether window has been closed or not. The closed property tells you whether or not a window opened using window.open(). Once a window is opened in JavaScript, its closed property is immediately initialized, with a value of false. When the newly opened window is closed, then the closed property of this window is set to a value of…
JavaScript Browser Objects Part 2
JavaScript Browser Objects Part 2 In this JavaScript tutorial, you will learn about Browser Objects viz button object properties of button object, form, name, value, Methods of button object, checkbox object, properties of checkbox object – checked, defaultChecked, form, name, type, value, Methods of checkbox object – blur(), click() and focus(). button object: The button object is a browser object in JavaScript that is used to access a form button other than submit or reset. The button object is a property of the form object. General syntax of button object in JavaScript is as follows: <INPUT TYPE="button" NAME="some button name"…
JavaScript Location Object Properties
JavaScript Location Object Properties In this JavaScript Tutorial you will learn about Properties of Location Object – hash, host, hostname, href, pathname, port, protocol and search property The Location object contains information about the current URL. This representation is a string that denotes the different portions of the URL as below: <protocol>//<host>[:<port>]/<pathname>[<hash>][<search>] The location object has a number of properties and methods in it. The usage, syntax and explanation with examples of each of the properties and methods of the Location object are explained in this section and the following sections. Properties of Location Object: hash: The hash property of…
JavaScript Browser Objects
JavaScript Browser Objects In this JavaScript tutorial, you will learn about browser objects in JavaScript, categories of browser-based objects, additional browser objects, anchor object, link object, properties of link object and methods of link object. JavaScript supports a number of browser-based objects. When a webpage loads by a browser that supports JavaScript, the browser creates a variety of JavaScript objects. This makes it possible to access the web page and handle elements, like HTML. There are a vast number of browser objects for JavaScript. This section highlights some of the most vital and supported by most popular browsers. With the…
JavaScript Applet Objects
JavaScript Applet Objects In this JavaScript tutorial, you will learn about applet object, properties and methods of applet object, Methods of applet object, area object, Properties of area object viz. hash, host, hostname, href, pathname, port, protocol, search and target. applet object: The applet object is used in JavaScript to access a Java applet. User can make use of the applets array to access all the applets contained in a document. The applets array property gives access to all the applets associated with the document. The applet object is a browser object that is a property of the document object, used…
JavaScript Document Object Properties
JavaScript Document Object Properties In this JavaScript tutorial, you will learn about Document Object Properties viz. formName, forms, images, lastModified, layers, linkColor, links, plugins, referrer, title, URL and vlinkColor. formName: Using the formName property, any form in the document can be referred and the formName is assigned as <FORM NAME = "formID">. General syntax for using the formName property is as follows: document."formname" forms: When a programmer wants to refer all the Form objects in a current document, then he or she can make use of the forms property. The forms property is an array that gives reference to all…
JavaScript Event Object Properties and Methods
JavaScript Event Object Properties and Methods In this JavaScript tutorial, you will learn about event object properties and methods like keycode, layer, offset, modifiers, page, reason, returnValue, screen, srcElement, target, srcFilter and type. keycode: The keycode property of event object is used to indicate the keycode associated with the key press of the event. The returned value is a Unicode keycode. If a user wants to convert the value as string, then the predefined function fromCharCode() must be used for conversion. The property keycode is supported only by Internet Explorer and in Navigator, the property named charCode is used to…
JavaScript Arrays
JavaScript Arrays In this JavaScript tutorial, you will learn about JavaScript Array, different ways of defining an array in JavaScript viz. traditional way, shorter form, literal array, accessing the elements in an array and editing the values or elements in an array. The array concept is used to store a set of values in a single variable name. This is a very important concept in any programming language. In this section, how to define and handle arrays in JavaScript is examined. In order to work with the concept of arrays in JavaScript, there are many sections the programmer must become…
JavaScript Two Dimensional Arrays
JavaScript Two Dimensional Arrays In this JavaScript tutorial you will learn about two dimensional arrays – how to define and access two dimensional array in JavaScript. Two Dimensional Arrays in JavaScript: Two Dimensional Arrays are storing elements in a structure similar to that of a table. Defining Two Dimensional Arrays in JavaScript: One of the vital points to note is JavaScript does not support multi-dimensional arrays and thereby does not support Two Dimensional Array. In order to create a Two Dimensional Array in JavaScript, the programmer must use the concept of creating the Single Dimensional Array while employing a small trick in…
JavaScript Boolean Object
JavaScript Boolean Object In this JavaScript tutorial you will learn about JavaScript boolean object, how to pass value to the boolean object, properties and methods used with boolean object. Usage of the Boolean Object: The Boolean object is a wrapper for the Boolean data type. The Boolean object is used to convert a non-Boolean value to a Boolean value. If a programmer wants to convert a non-Boolean value to a Boolean value, he can use Boolean as a function to perform this task, instead of using a Boolean object to convert a non-Boolean value to a Boolean value. The Boolean…
JavaScript Array Object
JavaScript Array Object In this JavaScript tutorial, you will learn about JavaScript Array Object, its properties and methods. Usage of the Array Object: The Array object is used to store a set of values in a single variable name. There are many operations involved with Array object: Defining Array object Adding Values to Array Accessing Array Editing or Modifying the Values of an Array These topics have been addressed in previous sections on Arrays in JavaScript. In this section, the properties and methods of Array Object in JavaScript will be outlined. Properties of array Object: length: The length property of…
JavaScript Functions
JavaScript Functions In this JavaScript tutorial, you will learn about JavaScript functions and how to create them. What is a function? Function is a block of code that can be reused as and when needed at various places. The function executes whenever it is called. JavaScript Functions: How does a programmer define, create and handle functions in JavaScript? In JavaScript, the programmer must learn the following broad classifications to fully understand the concept of functions. Idea of JavaScript functions Creating a function in JavaScript Passing values to function Returning values from a function Idea of JavaScript Functions: As mentioned above,…
Passing values to JavaScript Function
Passing values to JavaScript Function In this JavaScript Tutorial you will learn about how to pass values to and also how to return values from a JavaScript function. Passing Values to function: Values can be passed to a function as parameters. The general syntax for passing values to a function in JavaScript is: function name_of_function(argument1,argument2,…argumentn) { ………………………………………… //Block of Code ………………………………………… } In the above argument1, argument2,…argumentn represents the values passed to the function. For Example: Suppose a programmer wants to create a function with name exforsys, which takes two values x and y. These two values are passed from…
Working with JavaScript DOM Objects
Working with JavaScript DOM Objects In this JavaScript tutorial, you will learn about DOM object – window, properties of window object, methods of window object, screen, properties of screen object, navigator, properties of navigator object, methods of navigator object, history, property of history object, methods of history object, location, properties of location object and methods of location object. DOM stands for Document Object Model. Document Object Model or DOM is a set of objects that allow programmers scripts to integrate with the browser and work with documents, windows, forms, and other components. The biggest feature that JavaScript has over basic…
JavaScript Frame object
JavaScript Frame Object In this JavaScript tutorial, you will learn about frame object its properties and methods in detail with example. frame object, properties of frame object, frames, self, name, length, parent, methods of frame object, blur(), focus(), setInterval(), clearInterval(), setTimeout(expression, milliseconds), clearTimeout() and events associated with frame object. Frame Object: The frame object is a browser object of JavaScript used for accessing HTML frames. The user can use frames array to access all frames within a window. Using the indexing concept, users can access the frames array. NOTE: The frames array index always starts with zero and not 1….
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More Privacy & Cookies Policy