Questions tagged [window-object]

The Window object is a DOM interface that represents a browser window/tab that contains a DOM document. The Window object is defined in the HTML specification.

See also:

94 questions
3
votes
2 answers

How to redirect to the previous page in Angular 8

I have a component to which the user can reach from various pages. When the user clicks an OK button in this component, he should be redirected to the previous page ie. the page from where he came to this component. I came across…
Ramya
  • 225
  • 1
  • 6
  • 15
3
votes
1 answer

How can I use a window object in Angular 2?

I tried to put the following code to get a window object in angular 2: @Component({ selector: 'app-slider', templateUrl: './slider.component.html', styleUrls: ['./slider.component.css'], providers: [ …
Martin
  • 33
  • 1
  • 1
  • 5
3
votes
2 answers

TypeScript: How to replace imports with window objects?

I created a TypeScript module which requires a third-party library: import Dexie from "dexie"; namespace storage { ... } When I compile my TypeScript file, I get the following JavaScript output: "use strict"; var dexie_1 = require("dexie"); var…
Benny Code
  • 51,456
  • 28
  • 233
  • 198
3
votes
3 answers

dot notation , window object and its properties

I am trying to learn some new concepts about javascript.Here is a simple code I wrote. Inside a function THIS keyword refers to global object which is window unless it's bind with the context of another object. Inside myobj object there are two…
AL-zami
  • 8,902
  • 15
  • 71
  • 130
3
votes
3 answers

Why does window.parent self-reference?

I understand from documentation and several related StackOverflow posts that window.parent, if there is no other parent, will self-reference and thus never be undefined. I can't seem to find a decent reason as to why this is. JavaScript does have…
Cellivar
  • 568
  • 10
  • 27
3
votes
2 answers

How to insert HTML/JS into window (of type "panel") created by chrome.windows.create?

I'm creating a window in a Chrome Extension using chrome.windows.create. It's of type panel, so it's not a regular browser window or tab, but a free-standing window floating above all others. Having created it, I now need to insert some HTML and…
3
votes
1 answer

Javascript .onload not firing in IE? window.open reference issue?

I haven't been able to make sense of the answers to related questions so far(down to my knowledge level), so... I have a simple script(using jQuery) that opens a new window and adds certain content from the parent into a specified container inside…
soba3
  • 389
  • 3
  • 11
3
votes
1 answer

Window Object in Iframe

If I have an iframe that loads a page from an external domain, and that external page has javascript code that accesses the Window Object, would that break the execution of that javascript? I mean would the script get executed as it would in a…
tsjamm
  • 125
  • 1
  • 12
2
votes
4 answers

Attaching a function to window object in Webpack 5

I recently updated to Webpack 5 from Webpack 4, earlier I had a function on window object in index.js such that it looked something like index.js window.someFunction = function (...arguments) { // function body } when this index.js gets bundled…
Miraaj Kadam
  • 59
  • 2
  • 4
2
votes
0 answers

How to get the performance KPI's from performance.window.performance.timing output?

Trying to fetch the UI Performance KPI's using puppeteer framework, I have the following script const puppeteer = require('puppeteer'); const select = require('puppeteer-select'); (async () => { const launchOptions = { headless: false, …
user14295003
2
votes
1 answer

this. references Object instead of Window-Object

I have an Object like shown below. On line 6 I write console.log(this.title, elem). Now according to what I learned about this.-Keyword, this.title shouldn't reference the current Object here, but the global Window-Object. Now contrary to my…
Josh
  • 125
  • 7
2
votes
2 answers

{skipLocationChange : true} in router.navigate not working; changing the state

I am trying to embed Angular app on JSP page, for some reasons I need browser to preserve the state and don't want angular to push new state to browser history. As per Angular documentation { skipLocationChange: true } will allow me to do that.…
Akshay Naik
  • 669
  • 1
  • 6
  • 22
2
votes
1 answer

window.onstorage is not working with Angular

I'm trying to create window event listener that must listen for the event in the other tab, where opened another instance of the same application. Some service: public validateItemAgainstServer = (item: EspApplication) => { ... …
andrey.shedko
  • 3,128
  • 10
  • 61
  • 121
2
votes
0 answers

Print list of input text box without using windows.print()

How to print the user input textbox. In the current jsfiddle I have attached my demo. I am using windows popup to display current HTML in a new page and print only the displayed items. How do I display input box values in the current…
BUlle7
  • 153
  • 3
  • 15
2
votes
3 answers

window[name] equivalent to dynamically access const and let declarations

The old style JavaScript var declaration outside of a closure is global (top-level scope) and can be accessed in a browser from the window object. For example, the declaration var x = 3; can be accessed with window['x']. How do you similarly access…