4

In Silverlight it's possible to create a child window within your app with the CLICK of a button. SO i'm just wondering.... is it possible to have one in html5 with javascrip?

a child window is just a window that you can move around and it can display stuff such as say........ a text chat with another online user.

NoTiG
  • 121
  • 1
  • 9

1 Answers1

1

Sure, window.open. https://developer.mozilla.org/en-US/docs/Web/API/Window.open

example:

var windowObjectReference;
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";

function openRequestedPopup() {
  windowObjectReference = window.open("http://www.cnn.com/", "CNN_WindowName", strWindowFeatures);
}

Bear in mind some browsers will block this.

spassvogel
  • 3,479
  • 2
  • 18
  • 23
  • 1
    I believe the blocking only happens if the call to open isn't done with a user interaction event in the stack. If the user initiated the code then it shouldn't be blocked. It's only the non user initiated calls that are blocked. And for a little clarification this answer talks about using your own content within the opened window: http://stackoverflow.com/questions/2109205/open-window-in-javascript-with-html-inserted – HJ05 Feb 19 '14 at 16:14