Trending September 2023 # Examples And Properties Of Jquery Window # Suggested October 2023 # Top 12 Popular | Speedmintonvn.com

Trending September 2023 # Examples And Properties Of Jquery Window # Suggested October 2023 # Top 12 Popular

You are reading the article Examples And Properties Of Jquery Window updated in September 2023 on the website Speedmintonvn.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested October 2023 Examples And Properties Of Jquery Window

Definition of jQuery window

Web development, programming languages, Software testing & others

Properties of jQuery window

Properties of the window Object are:

closed – This property represents whether a window is closed or not, it returns a Boolean value.

console – This property returns the Console object for logging to the browser’s console.

defaultStatus – This property uses to sets or gets the default text of a window status bar.

document – This property uses to gets the Document object for the window.

history – This property uses to get the History object for the window.

innerHeight – This property uses to get the height of the content area of the window with scrollbars.

innerWidth – This property uses to get the width of the content area of the window with scrollbars.

localStorage – This property allows to store key/value pairs in a web browser without an expiration date.

location – This property uses to get the window’s Location object.

name – This property uses to set or get the window’s name.

navigator – This property uses to get the window’s navigator object.

opener – This property uses to get a reference to the window which created the window.

outerHeight – This property uses to get the height of the browser window with including scrollbars or toolbars.

outerWidth – This property uses to get the width of the browser window with including scrollbars or toolbars.

pageXOffset – This property uses to get the scrolled of the current document in the upper left corner of the window (horizontally) in the pixels.

pageYOffset – This property uses to get the scrolled of the current document from the upper left corner of the window (vertically) in the pixels.

parent – This property uses to get the current window’s parent.

screen – This property uses to get the window’s Screen object.

screenLeft – This property uses to get the window’s horizontal coordinates relative to the screen.

screenTop – This property uses to get the window’s vertical coordinate relative to the screen.

screenX – This property uses to get the window’s horizontal coordinates relative to the screen.

screenY – This property uses to get the window’s vertical coordinate relative to the screen.

sessionStorage – This property allows to store key/value pairs data for one session in a web browser.

scrollX – This is an alias for pageXOffset.

scrollY – This is an alias for pageYOffset.

self – This property uses to get the current window.

status – This property uses to get or set the status bar text for a window.

top – This property uses to get the topmost browser window.

Methods of jQuery window

alert – This method is used to displays an alert box which contains some message and an OK button.

confirm – This method is used to displays a dialog box which contains some message, an OK and a Cancel button.

atob – This method is used to decodes a string of data that has been encoded using Base64 encoding.

btoa – This method is used to encodes a string of data using base-64.

blur – This method is used to remove the focus from the current window.

focus – This method is used to set focus on the current window.

clearInterval – This method is used to cancel a timer which has been set by setInterval().

clearTimeout – This method is used to cancel a timer which has been set by setTimeout().

open – This method is used to open the new browser window.

close – This method is used to close the current window.

getComputedStyle – This method is used to get the current CSS styles of an element applied.

getSelection – This method is used to get the Selection object which specifies the text selected by the user like a range.

matchMedia – This method is used to get the MediaQueryList object which specifies the couple of methods and properties which most frequently used being the matches property.

moveBy – This method is used to move the window relative to the current position

moveTo – This method is used to move the window to the specific position

print – This method is used to print the current window’s content.

prompt – This method is used to give prompts for user input.

requestAnimationFrame – This method is used to request the browser for animation update to call a function before the next repaint.

resizeTo – This method is used to resize a window to the given width and height.

resizeBy – This method is used to resize a window to the given pixels.

scrollTo – This method is used to scroll the document to the given coordinates. This is the replacement method for the Deprecated scroll() method.

scrollBy – This method is used to scroll the document to the given number of pixels.

setTimeout – This method is used to evaluates an expression or calls a function after a given number in milliseconds.

setInterval – This method is used to evaluates an expression or calls a function or at a given interval in milliseconds.

stop – This method is used to stop the loading of the window.

Examples

Example of jQuery window object to use properties and methods. Next, we write the HTML code to understand the jQuery window object more clearly with the following example, where we use properties and methods of the window object, as below –

Code:

var nwindow; function fun_open() { nwindow = window.open(“”, “newWindow”, “width=500, height=500”); } function property_apply() { if (!nwindow) { document.getElementById(“text”).innerHTML = “Not opened ‘newWindow’.”; } else { if (nwindow.closed) { document.getElementById(“text”).innerHTML = “Closed ‘newWindow’.”; } else { document.getElementById(“text”).innerHTML = ” Not closed ‘newWindow’..”; } } } function get_parent_window() { } function fun_close() { if (nwindow) { nwindow.close(); } }

Output:

The above program it demonstrating the use of some of the window properties and methods. As above in the code, it is used the document and opener properties and the open(), close() functions.

Conclusion

A jQuery window object is a browser object, which is automatically created by the browser.

Recommended Articles

This is a guide to jQuery window. Here we discuss the Description, properties, methods, examples with code implementation. You may also have a look at the following articles to learn more –

You're reading Examples And Properties Of Jquery Window

Update the detailed information about Examples And Properties Of Jquery Window on the Speedmintonvn.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!