Author: Saim Khalid
-
History Object
Window History Object In JavaScript, the window ‘history’ object contains information about the browser’s session history. It contains the array of visited URLs in the current session. The ‘history’ object is a property of the ‘window’ object. The history property can be accessed with or without referencing its owner object, i.e., window object. Using the…
-
Screen Object
Window Screen Object The screen object in JavaScript is a property of the ‘window’ object. The ‘screen’ object’s properties contain information about the device’s screen. The screen object can be accessed by using the window.screen syntax. We can also access it without using the window object. Screen Object Properties The screen object has a number of properties that provide information about the screen’s orientation, resolution,…
-
Document Object
Window Document Object The document object is a JavaScript object that provides the access to all elements of an HTML document. When the HTML document is loaded in the web browser, it creates a document object. It is the root of the HTML document. The document object contains the various properties and methods you can use to get details about HTML…
-
Window Object
The JavaScript window object represents the browser’s window. In JavaScript, a ‘window’ object is a global object. It contains the various methods and properties that we can use to access and manipulate the current browser window. For example, showing an alert, opening a new window, closing the current window, etc. All the JavaScript global variables are properties…
-
Browser Object Model
The Browser Object Model (BOM) in JavaScript refers to the objects provided by the browsers to interact with them. By using these objects, you can manipulate the browser’s functionality. For example, you can get the browser history and window size, navigate to different URLs, etc. The Browser object model is not standardized. It depends on…
-
Deleting Cookies
In order to delete cookies with JavaScript, we can set the expires date to a past date. We can also delete a cookie using the max-age attribute. We can delete the cookies explicitly from the browser. Deleting cookies with JavaScript removes small bits of data that websites store on a user’s computer. Cookies are used…
-
Cookie Attributes
Cookie Attributes The JavaScript cookie attributes are used to set additional information about a cookie such as path, domain, expiry date, etc. In JavaScript, you can specify the cookie attributes while setting up a new cookie or updating the cookie. For example, you can set the cookie’s expiry date using the ‘expires’ attributes. In simple…
-
Cookies
What are Cookies ? In JavaScript, cookies are piece of data stored in the user’s web browser. The cookies are stored in the key-value pair inside the browser. We can manipulate the cookies using cookie property of document object. We can set or store a cookie in key-value pair using the cookie property. We can…
-
setInterval Method
JavaScript setInterval() Method In JavaScript, the setInterval() is a window method that is used to execute a function repeatedly at a specific interval. The setTimeout() Method allows you to execute the function only once after the specified time. The window object contains the setInterval() method. However, you can execute the setInterval() Method without taking the…
-
setTimeout Method
JavaScript setTimeout() Method In JavaScript, the setTimeout() is a global method that allows you to execute the function or a particular JavaScript code only once after a specified time. The window object contains the setTimeout() method. You may use the window object to execute the setTimeout() method. The setTimeout() method can also be used to…