1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Java Script Tutorials

window object javascript

<html>
<head>
<script language="javascript">
opened=0
window.defaultStatus="Program using window object"
function func1()
{
var1=open("file1.html","win1", "menubar=no,toolbar=no")
opened=1
window.status="file1.html is now opened"
}
function func2()
{
if(var1.closed)
{
alert("Window Already Closed")
window.status="file1.html is closed"
}
else
{
var1.close()
window.status="file1.html is closed"
opened=0
}
}
function func3()
{
if(!var1.closed)
{ alert("child window open-cannot close")}
else
{if(confirm("close window?"))
{ window.close()}
}
}
function func4()
{
if(opened==1)
{
var1.document.bgColor="red"
var1.focus()
}
else
{
alert("file1.html window not open")
}
}
function func5()
{
if ((!var1.closed)&&(opened==1))
{
var1.document.bgColor="blue"
var1.focus()
}
else{alert("file1.html window not opened")
}
}

function func6()
{
if ((!var1.closed)&&(opened==1))
{
var1.document.bgColor="green"
var1.focus()
}
else
{
alert("file1.html window not open")
}
}
</script>
</head>


<body>
<center>
<br><br>
<input type="button" name= "but1" value="open file1.html" onclick='func1()'>
<br><br>
<input type="button" name="but2" value="close file1.html" onclick='func2()'>
<br><br>
<input type="button" name="but3" value="close this window" onclick='func3()'>
<br><br>
<hr align="center" width="50%">
<p align="center">Click the buttons below to chnage background color of new window</p>
<input type="button" name='but4' value="red" onclick='func4()'>
<input type="button" name='but5' value="blue" onclick='func5()'>
<input type="button" name='but6' value="green" onclick='func6()'>
</center></body></html>

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy