Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do i create and access a "remote control"?

Posted on 1998-07-15
4
Medium Priority
?
145 Views
Last Modified: 2010-04-09
I need to create a "remote control" browser, that I can access via ASP. For example, if I search a database, I want the result to be displayed on this "remote control" (floating over the main browser, preferably with Stay On Top feature enabled if possible), and when I click a link in the remote it should then affect something in the first (main) browser.
If there is anyone that knows how this is done, i'd be a very happy programmer :-)
0
Comment
Question by:Dempa
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
santacruz earned 400 total points
ID: 1844622
Dempa

Begin by typing the following in the body tag of your main document

onLoad=makeRemote()

Next create a script like the one below

<script language="javascript">
<!--
function makeRemote(){
remote=window.open("","remotewin","alwaysRaised=yes");
remote.location.href=("URL OF THE REMOTE DOCUMENT");
if (remote.opener == null)remote.opener=window;
remote.opener.name="opener";
}
//-->
</script>

This creates the remote you are looking for, but the always on top part will only work in N4. Also be sure to make the window.open code on one uninterrupted line.

To reference the opener window type the following code inside the remote document

<script language="javascript">
<!--
function go(url){
opener.location.href=url;
}
//-->
</script>
Now whenever you create a link in the remote document use the psudeo-protocol

<A href="javascript:go('SOME URL')"> THE LINK </A>

If your using forms just create a regular form and just direct the target attribute to "opener"

good luck!
santacruz
0
 

Author Comment

by:Dempa
ID: 1844623
Great, It works...but could you please comment the code you gave so I know what each line does?
Also, how do I set the properties of the new window? I should probably mention that I have very little experience programming Javascript...
Can this be done in ASP in VBscript code instead? If so, does anyone know how?
0
 

Expert Comment

by:santacruz
ID: 1844624
Dempa

You can set the remote window properties via the function code

remote=window.open("","remotewin","alwaysRaised=yes","hieght=300","width=200","etc,etc,etc")

onLoad tells browser to launch the remote during the load process

makeRemote( ) is the function to create the new window

remote=window.open( ) is the code that gives idenity to the new window

remote.location.href( )lets the browser know where to find the new window document

if(remote.opener) statement is to name the main window opener.This is done by defult with newer browsers but this statement will handle any older browsers.

function go(url) is setup to redirect href's to the main window

santacruz
0
 

Author Comment

by:Dempa
ID: 1844625
Thanx alot!
//Dennis
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question