Showing posts with label Java Script. Show all posts
Showing posts with label Java Script. Show all posts

opener property in Java Script

2 comments
Using "opener" property, we can access the main window from the newly opened window.

Let's create Main page:

<html>
<head>
<title>Main Page</title>
</head>
<body>
<form>
<input type="button" value="Open another page"
onClick="aa=window.open('test.htm','','width=100,height=200')">
</form>
</body>
</html>

Then create Remote control page (in this example, that is test.htm):
<html>
<head>
<title>Child Page</title>
<script>
function remote(url)
{
window.opener.location=url
}
</script>
</head>

<body>
<p><a href="#" onClick="remote('file1.htm')">File1</a></p>
<p><a href="#" onClick="remote('file2.htm')">File2</a></p>
</body>

</html>
Continue Reading...

Remote window

0 comments
<html>
<head>
<title>Remote window</title>
</head>
<body>
<form>
<input type="button" value="Open another page"
onclick="aa=window.open('test.htm','','width=200,height=200')">
<input type="radio" name="x" onclick="aa.document.bgColor='red'">
<input type="radio" name="x" onclick="aa.document.bgColor='green'">
<input type="radio" name="x" onclick="aa.document.bgColor='yellow'">
</form>
</body>
</html>
Continue Reading...

Loading

0 comments
  • The basic syntax when loading new content into a window is:
    window.location="test.htm"
  • This is the same as
    <a href="test.htm>Try this </a>
Continue Reading...

Close a Window

0 comments
  • Your can use one of the codes shown below:
    <form>
    <input type="button" value="Close Window" onClick="window.close()">
    </form>
  • This is the same as
    <a href="javascript:window.close()">Close Window</a>
Continue Reading...
> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger