function
fOpen() {
window.open();
}
var
newWin =
null
;
funOpen() {
newWin = window.open(
''
,
'width=400, height=400, top=150, left=250'
);
funAddNote() {
//if a window is open
if
(newWin.closed ==
false
) {
newWin.document.open();
newWin.document.write(
'<h1>Hello World!</h1>'
newWin.document.close();
funFocus() {
newWin.focus();
funBlur() {
newWin.blur();
funMoveTo() {
newWin.moveTo(500, 50);
funResizeTo() {
newWin.resizeTo(200, 200);
funClose() {
newWin = newWin.close();
window.onload =
() {
document.getElementById(
'b1'
).onclick = funOpen;
'b2'
).onclick = funAddNote;
'b3'
).onclick = funFocus;
'b4'
).onclick = funBlur;
'b5'
).onclick = funClose;
ara = document.getElementsByTagName(
'input'
for
(
i=0; i<ara.length; i++) {
ara[i].style =
'width: 55px'
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
a
href
"javascript:fOpen()"
>open()</
label
>Open new window. No of parameters.</
br
input
id
"b1"
type
"button"
value
"open()"
>Open new window. Yes parameters.</
"b2"
"add"
>Add a note</
"b3"
"get()"
>Get a focus of a window.</
"b4"
"blur()"
>Delete a focus of a window.</
"javascript:funMoveTo()"
>funMoveTo()</
"javascript:funResizeTo()"
>funResizeTo()</
"b5"
"close()"
>Close window.</