[WEB4LIB] javascript/URL targets

TMGB bennettt at am.appstate.edu
Thu Sep 24 16:02:21 EDT 1998


I'm not sure about a none JScript version so, although this is javascript I'll
submit it for what its worth,( uh , whats it worth?$$$)
it appears to me that the line in the index page
        remote.opener = self;
says to use that index page for the target.

and the "http://..." in this page is definitly the remote control html
    remote.location.href =

The code is copyright but licensed for free according to the shown comments.
And for those that aren't aware, the ^M is a carriage return from creating a
file in DOS and serving it on a UNIX machine or at least having it open with vi
on a unix machine.



The index page at
http://am.appstate.edu/~bennettt/Grandfather/remote/index.html
is shown below.  The email link is incorrect.  I did this over a year ago to
experiment with remote so it hasn't been updated and my style was much crudeder
than it is today, please forgive. Its only a background picture with the submit
button for the "reomte control"

Index.html
----------------------------------------------------------------------------------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
   <TITLE>Grandfather Mountain Test Page</TITLE>
   <META NAME="GENERATOR" CONTENT="Mozilla/3.0Gold (Win16; I) [Netscape]">

<SCRIPT LANGUAGE = "JavaScript">


/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates, ^M
 * all rights reserved. In order to receive the right to license this ^M
 * code for use on your site the original code must be copied from the^M
 * Web site webreference.com/javascript/. License is granted to user to ^M
 * reuse this code on their own Web site if and only if this entire copyright^M
 * notice is included. Code written by Nick Heinle of webreference.com.^M
 */

<!--
var remote = null;
function remoteStart() {
    remote = window.open('', 'RemoteControl',
'width=180,height=330,resizable=1');
    if (remote != null) {
    if (remote.opener == null) {
        remote.opener = self;
        }
    remote.location.href =
'http://www.acs.appstate.edu/~bennettt/Grandfather/remote/remote.html';
    }
}
//-->

</SCRIPT>

</HEAD>
<BODY TEXT="#000000" BGCOLOR="#C0C0C0" LINK="#0000FF" VLINK="#800080"
ALINK="#FF0000" BACKGROUND="luksoth.gif">
<BR>
<FORM>
<INPUT TYPE = "button" VALUE = "Menu" onclick = "remoteStart()">
</FORM>
<BR>
</BODY>
</HTML>


-----------------------------------------------------------------------------------------------------------------

The actual "remote control" page basically replace your urls with the ones
inside the parenthesis of JavaScriptfetch().
and the On mouse over text

-----------------------------------------------------------------------------------------------------------

Menu Page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
   <TITLE>Grandfather Mountain Test Page</TITLE>
   <META NAME="GENERATOR" CONTENT="Mozilla/3.0Gold (Win95; I) [Netscape]">
<SCRIPT LANGUAGE = "JavaScript">


<!--
function fetch(url) {
        opener.location = url;
        }

function done() {
      window.close()
       }

function message(txt){
        opener.status = txt;
        setTimeout("remove()",5500);
        }

function remove(){
        opener.status="";
        }

//-->


</SCRIPT>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#C0C0C0" LINK="#0000FF" VLINK="#800080"
ALINK="#FF0000" BACKGROUND="fleur01.gif">
<CENTER><P>Click on the <IMG SRC="PURPLED.GIF" HEIGHT=14 WIDTH=14></P></CENTER>
<P><CENTER>Best viewed with Netscape 3.x or 4.x</CENTER></P>
<CENTER><TABLE>
<TR>
<TD><A
HREF="JavaScript:fetch('http://www.acs.appstate.edu/~bennettt/Grandfather/remote/')"
onMouseOver="message('The Jim Morton photo');return true;"><IMG
SRC="PURPLED.GIF" BORDER=0 HEIGHT=14 WIDTH=14 ALT=' HOMEPAGE '></A></TD>
<TD>The Jim Morton photo </TD>
</TR>
<TR>
<TD><A
HREF="JavaScript:fetch('http://www.acs.appstate.edu/~bennettt/Grandfather/remote/Overview/Overview.html')"
onMouseOver="message('A synopsis of this site');return true;"><IMG
SRC="PURPLED.GIF" BORDER=0 HEIGHT=14 WIDTH=14 ALT=' SYNOPSIS OF THIS SITE
'></A></TD>
<TD>Overview </TD>
</TR>
<TR>
<TD><A
HREF="JavaScript:fetch('http://www.acs.appstate.edu/~bennettt/Grandfather/remote/Bio/Morton.html')"
onMouseOver="message('Meet Hugh Morton');return true;"><IMG SRC="PURPLED.GIF"
BORDER=0 HEIGHT=14 WIDTH=14 ALT=' SHORT BIOGRAPHY '></A></TD>
<TD>Meet Hugh Morton </TD>
</TR>
<TR>
<TD><A
HREF="JavaScript:fetch('http://www.acs.appstate.edu/~bennettt/Grandfather/remote/NewEvents/NewEvents.html')"
onMouseOver="message('New events at Grandfather Mountain');return true;"><IMG
SRC="PURPLED.GIF" BORDER=0 HEIGHT=14 WIDTH=14 ALT=' NEWS '></A></TD>
<TD>New Events</TD>
</TR>
<TR>
<TD><A
HREF="JavaScript:fetch('http://www.acs.appstate.edu/~bennettt/Grandfather/remote/Calendar/Calendar.html')"
onMouseOver="message('Calendar of seasonal events');return true;"><IMG
SRC="PURPLED.GIF" BORDER=0 HEIGHT=14 WIDTH=14 ALT=' CALENDAR OF EVENTS
'></A></TD>
<TD>The Calendar </TD>
</TR>
<TR>
<TD><A HREF="JavaScript:fetch('http://www.pbs.org')" onMouseOver="message('The
Public Broadcast System Homepage');return true;"><IMG SRC="PURPLED.GIF" BORDER=0
HEIGHT=14 WIDTH=14 ALT= ' www.ppbs.org '></A></TD>
<TD>Public Broadcast System</TD>
</TR>
</TABLE></CENTER>
<P>
<CENTER>
<FORM><INPUT TYPE="button" VALUE = "Close Menu" onClick = "done()"></FORM><BR>
</CENTER>
Email the author: <BR>
<CENTER>
<A HREF="mailto:bennettt at am.appstate.edu" ALT= 'Email the Author'>bennettt</A>
<IMG SRC="E-MAIL.GIF" HEIGHT=14 WIDTH=15 ALIGN=CENTER><A
HREF="mailto:bennettt at xx.acs.appstate.edu" ALT= 'Email the
Author'>xx.acs.appstate.edu</A>
</CENTER>
<BR>
</P>
</BODY>
</HTML>






Kevin W. Bishop wrote:

> I realize this can be done w/o using javascript in a much simpler fashion,
> but please humor me for a second.
>
> At the bottom of a page we're developing, we have inserted
>
> <FORM>
> <INPUT TYPE="button" VALUE="Site Info" onClick="site_info();">
> </FORM>
>
> // which opens the following
>
> function site_info()  {
>    iwin = window.open("site_info.html","IWIN",
>
> "scrollbar=yes,status=yes,resizable=yes,toolbar=yes,location=yes,menu=yes,wi
> dth=325,height=375");
> }
>
> [The coding isn't in that order, of course.]
> We would like the hyperlinks inside this newly opened browser to target the
> initial browser window.  In other words, rather than clicking links and
> have the pages appear in the newly opened browser, we would like the
> initial browser (containing the "site info" button) to be receiving the
> requested documents.  (I've heard this described as the "remote-control"
> effect.)
>
> We've mucked around w/the script and w/the TARGET attribute in places w/o
> luck, and haven't been able to find any websites with related information.
> Any suggestions?  (Replies offlist are probably most appropriate.)
>
> Thanks.
> -kb
>
> _______________________________________________________________________
>
> Kevin W. Bishop                              bishopk at rpi.edu
> Campus-Wide Information System Coordinator   http://www.rpi.edu/rpinfo
> Rensselaer Polytechnic Institute             http://www.rpi.edu/
> 110 8th St. Troy, NY, 12180-3590
> (518) 276-8332   Fax  276-8559
> ______________________________________________________________________



--
-------------------------------------------------------------------------
Thomas McMillan Grant Bennett           Appalachian State University
Computer Consultant II                  University Library
bennettt at am.appstate.edu                http://www.library.appstate.edu/admin/
Voice:  704 262 2797   FAX:    704 262 3001

Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit operating
system that was originally coded for a 4-bit microprocessor.
 - Chris Dunphy     Boot Magazine




More information about the Web4lib mailing list