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
0
votes
1 answer

Angular 6 injecting window token in library service

I have a library that has the code from this website post: https://brianflove.com/2018/01/11/angular-window-provider/ In my library, I also have a service where I want to have access to the window object. However, adding in the following to the…
annihilate
  • 598
  • 1
  • 5
  • 16
0
votes
0 answers

how to distinguish that a window popup is opened from normal tab or from a chrome extension?

I am working on a chrome extension app, here I am opening a new window(with url:xyz.com) from chrome extension app, and the same codebase is deployed in a server(url:xyz.com) as well as with the same functionality(opening new window popop,…
Sk Asif
  • 65
  • 7
0
votes
0 answers

Javascript 'this' operator

I'm struggling to understand why the output of this command is not 10. var x = 10; console.log(this.x); On the other hand, when x is global the output is indeed 10. x = 10; console.log(this.x); how come in the first example it does'nt print '10'?…
Lior
  • 1
  • 3
0
votes
0 answers

React: Set values in Window coming back as undefined

I'm setting a script in my HTML for a geoplugin, assigning the results to the window, and trying to access the variables in a component. The issue is, in the component, I can console.log(window) and see the variables, but any dot notation results in…
Cameron
  • 567
  • 1
  • 5
  • 13
0
votes
1 answer

Open new window in background on

I'm trying to open new windows in the background in Google Chrome version 62.0.3202.94. I run the code by typing in Notepad and copy-pasting into F12 Developer Console. This is the code I've tried so far, adapted from various Google search…
iBug
  • 35,554
  • 7
  • 89
  • 134
0
votes
1 answer

window.crypto.subtle not working in IIS hosted web application

I'm using window.crypto.subtle.importKey() for one of the authentication process in my app. Its working when i ran it on node server but its not working when i hosted it on IIS. Error: importKey of undefined (Till window.crypto i'm getting)
Akhil Naidu
  • 789
  • 1
  • 4
  • 16
0
votes
1 answer

Why does window.performance.timing.domContentLoadedEventStart return 0

Below is my js function code. console.log(window.performance.timing); console.log(window.performance.timing.domContentLoadedEventStart); When i run the above code by running my js file, window.performance.timing returns an object in which…
user2613946
  • 435
  • 2
  • 7
  • 17
0
votes
2 answers

Wisita onReady event firing multiple times in Angular controller

Looking for some help on how to prevent onReady from firing multiple times in an Angular/Ionic app when used in conjunction with $window. Specifically, we're using this method for Wistia videos (as instructed here). The offending code…
0
votes
1 answer

calling a function from its string name on Window object

Why is the test fuction declaration not found in the window object? Thanks !function(){ function test(){ console.log("testing"); } var check = window["test"] console.log(check); //undefined }();
succeed
  • 834
  • 1
  • 11
  • 28
0
votes
2 answers

Why is `this` set to `window` if I use `function.apply(undefined, args)`?

Take a look at this example: function aaa () { console.dir(this) } function bbb () {} aaa.apply(undefined, [1,2,3]) // this in aaa is `window` object aaa.apply(bbb, [1,2,3]) // this in aaa is `bbb` function Why is this set to window in first…
bodacydo
  • 75,521
  • 93
  • 229
  • 319
0
votes
2 answers

Call a window object in a function

I'm searching for access a window object into a function (actually, an ajax callback function but nevermind). So, I found a tuto where the guy explain my problem and why I have this problem but he doesn't resolve it. Well, when I want to access the…
Erlaunis
  • 1,433
  • 6
  • 32
  • 50
0
votes
0 answers

Assigning value to declared variable vs. assigning variable to non-declared variable?

What is the diference between assigning value to declared variable and assigning value to non-declared variable ? I got a case where it have a difference. Go to chrome browser console and put this code: var x=8; delete x; //it will return false…
Mukund Kumar
  • 21,413
  • 18
  • 59
  • 79
0
votes
1 answer

How to track/preserve global namespace in Javascript

I was wondering what would be the best way to track changes made to the global namespace by some external javascripts. For example, lets say I have a website and I would like to know which object are being added to the global namespace by some third…
demonius
  • 3
  • 3
0
votes
1 answer

Call JavaScript val using window object & object key pair

Okay, so I really would rather avoid using eval at all costs, so I'm trying to figure out an alternative to calling a global function using the window object method: var time = new Date(); var varname = time.getDay(); var obj =…
CJT3
  • 2,788
  • 7
  • 30
  • 45
0
votes
2 answers

Why does jQuery send in window to itself when it can just call it from within

I tried this myself and I suppose its some sort of closure catch but I dont see the difference in this: (function() { var tvLib = {} window.tvLib = tvLib })(); from the jQuery way of : (function(window, undefined) { var jq; window.jq =…
Todd Vance
  • 4,627
  • 7
  • 46
  • 66