0

This is literally day two in my total JavaScript experience, so please bear with me. I am able to open a new window, no problem. I can direct that window, when opened, to a certain URL. Again, no problem. I just can't seem to manipulate anything on the new window. Here is the code so far: (at the end of the script, I am closing the original window.)

var win = window.open("URL",'','channelmode,height=' + 
          window.screen.availHeight + ',width=' + window.screen.availWidth + ',')
var output = "<input type=\"button\" value=\"Close Window\" onclick=\"windowClose();\">"    

//Doesn't work..
win.document.body.innerHTML += output //also tried with just --> ...innerHTML = output
//

//Doesn't work..
win.dataFromParent = output
win.document.body.innerHTML(dataFromParent)
//win doesn't actually have the variable "dataFromParent" defined in the code, and I can't change the page that is loaded to include it, so is that why this isn't working?

//Doesn't work..
win.dataFromParent = output
win.document.body.appendChild(dataFromParent)
//

function windowClose() { 
    window.open('','_parent',''); 
    window.close();
} 
windowClose()  //Done in this manner to prevent the "Page trying to close window..." dialog box

There are two things that I am trying to do:

  1. On the opened window (win), place a button, at a certain position, that will close the window (win)

  2. On the opened window (win), disable the ability of someone being able to double-click the title bar and it changing the window size. (I know the "window.open" has a "resizable" option that can be set to "no" but that doesn't seem to actually work.)

These are the main links that I've used to try and figure out the first task.

Add content to a new open window http://www.computerhope.com/issues/ch000178.htm How to open a new window and insert html into it using jQuery? http://www.w3schools.com/jsref/met_win_open.asp

I really don't know how to do the second one...Everywhere that I've looked only has things like that for other languages..

Community
  • 1
  • 1
simple jack
  • 25
  • 1
  • 8

0 Answers0