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
344
votes
6 answers

window.location.href and window.open () methods in JavaScript

What is the difference between window.location.href and window.open () methods in JavaScript?
masif
  • 3,950
  • 4
  • 19
  • 22
49
votes
7 answers

Get all user defined window properties?

Is there a way to find out all user defined window properties and variables (global variables) in javascript? I tried console.log(window) but the list is endless.
GriffLab
  • 2,076
  • 3
  • 20
  • 21
45
votes
4 answers

Using the variable "name" doesn't work with a JS object

The behaviour can be seen in this little snippet (execute it as a global script): var name = {}; name.FirstName = 'Tom'; alert(name.FirstName); The alert yields undefined in Chrome but works in IE and Firefox. I also get a weird value when I…
Pialy Tapaswi
  • 521
  • 7
  • 9
30
votes
3 answers

Is javascript window.location crossbrowser?

Is javascript code window.location functional in all new and old STANDARD POPULAR browsers?
EBAG
  • 21,625
  • 14
  • 59
  • 93
12
votes
4 answers

Why do we write window.?

While adding some initialisation code to a webpage, I found myself writing window.onload = ... for the umptieth time, when a thought hit me. The window. isn't necessary, because window is the current object. So it's optional! But nobody writes just…
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
9
votes
3 answers

Accessing Window Object from .tsx file

Typically in my .ts files I can access the window object by calling something such as: (window).myObject I am getting compilation errors for this in my .tsx files. Is there any way I can access it from a .tsx file? Thanks.
Daniel R
  • 103
  • 1
  • 5
9
votes
1 answer

This works in Chrome but not IE, why?

var shell = function (method) { window[method].apply(null, Array.prototype.slice.call(arguments, 1)); }; shell('alert', 'monkey!');
shawndumas
  • 1,413
  • 15
  • 17
6
votes
1 answer

Qt 4.6 Adding objects and sub-objects to QWebView window object (C++ & Javascript)

I am working with Qt's QWebView, and have been finding lots of great uses for adding to the webkit window object. One thing I would like to do is nested objects... for instance: in Javascript I can... var api = new Object; api.os = new…
Cor
  • 61
  • 1
  • 4
6
votes
1 answer

Accessing the window from Angular expression

According to the developer guide I should be able to access the browser window from inside Angular expressions with $window. Unlike JavaScript, where names default to global window properties, Angular expressions have to use $window to refer to the…
tamacun
  • 421
  • 1
  • 4
  • 9
5
votes
1 answer

IE11- avoid Window close confirmation message

my requirement is when I click to download a file, new tab opens. If the file exists, it will start download and if not, it should close the new tab and show error message. I have used window.close() and it's working fine. Except that, IE11 asks…
4
votes
1 answer

Exception "Component is not available" when iterating over window object's properties

I'm trying to convert a Google Chrome extension to Firefox using Addon SDK (Jetpack). The following code (run as content-script) var property, winProperties = {}; for (property in window) { winProperties[property] = true; } throws this…
4
votes
2 answers

Passing variables to a newly opened window - nwj (node-webkit)

I am searching for hours now, on how to pass a variable to a newly opened window using node-webkit. The task is pretty simple (like HTTP POST), but there is no word about this, in the nwj (node-webkit) documentation. code I use to open new…
Edmond Tamas
  • 3,148
  • 9
  • 44
  • 89
4
votes
7 answers

Why doesn't my javascript function throw up an error?

After invoking my function, I was startled that my function didn't throw up an error due having a variable & using a variable not define in the function's scope. My question: Why doesn't my function throw an undefined,error, or the like? Shouldn't…
3
votes
1 answer

window.addEventListener('load', function) not working in angular application

I have a subscription in a component of angular app where I need to download PDF file from response. I am downloading PDF file after window.open() method has been called and later need to close current(new opened) tab via window.close()…
3
votes
0 answers

Can i open / focus a different tab within the same domain that i didn't open myself?

I have two instances of my Angular App running in two different tabs, I would like to be able to let the user switch between them by pressing a button on the site. I can communicate between the instances using the Broadcast Channel API, however…
1
2 3 4 5 6 7