Revisiting Old Concepts - Window Object

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 183:- Revisiting Old Concepts - Window Object

The Window object is a global object in the browser environment that represents the window containing a DOM document. It is the top-level object in the JavaScript hierarchy and represents the browser window that contains the document. All global variables and functions defined in a web page are properties and methods of the window object.

The Window object provides several properties and methods that allow you to interact with the browser window, such as:

  1. Document: Represents the DOM document that is loaded in the window.
  2. Location: Represents the URL of the current window or a redirect URL.
  3. History: Represents the history of the current window.
  4. Navigator: Provides information about the browser.
  5. Screen: Provides information about the user's screen.
  6. setTimeout() and setInterval(): Allow you to execute code after a specified amount of time or at a specified interval.
  7. alert(), prompt(), and confirm(): Allow you to display dialog boxes to the user.

Some examples of using the Window object:

  1. Accessing the DOM: You can access and manipulate the DOM of the current page by using the document property of the Window object.

javascriptCopy code

window.document.getElementById('myDiv').innerHTML = 'Hello, World!';

  1. Redirecting the current page:

javascriptCopy code

window.location.href = 'http://example.com';

  1. Opening a new window:

javascriptCopy code

window.open('http://example.com', '_blank', 'width=500,height=500');

  1. Setting a timeout:

javascriptCopy code

window.setTimeout(function() {    alert('Time is up!'); }, 5000);

Overall, the Window object is an essential part of the browser environment and provides a wide range of functionality for interacting with the user and the web page.

21. Closures

Comments: 2

profile
@niteshguptav63
17-Nov-2024, 01:39 PM

I am not able to access videos from second class and further. I have already completed first class

profile
@niteshguptav63
16-Nov-2024, 10:56 AM

When will I get my course?

profile
@admin79
17-Nov-2024, 01:29 PM

Now, Your query was resolved.

Frequently Asked Questions (FAQs)

How do I register on Sciaku.com?
How can I enroll in a course on Sciaku.com?
Are there free courses available on Sciaku.com?
How do I purchase a paid course on Sciaku.com?
What payment methods are accepted on Sciaku.com?
How will I access the course content after purchasing a course?
How long do I have access to a purchased course on Sciaku.com?
How do I contact the admin for assistance or support?
Can I get a refund for a course I've purchased?
How does the admin grant access to a course after payment?