Java and windows

Steve Ryan s.ryan at library.usyd.edu.au
Fri Feb 21 00:30:31 EST 1997


Thanks to all those who answered my request:
> I really like the idea of going from a text link within an html document to
> another document opened in a smaller window, while at the same time
> preserving the window/document that contains the link. I thought this would
> be helpful for a number of purposes e.g glossary of terms, images etc. I
> know very little about javascript beyond how to embed it in my documents.
> Has anyone got a script/example that I could use for this.



Heres a summary:
1)
Have a look at my page: http://www.molndal.se/bibl/subject.htm
and click on the link that says:
hur man anvander katalogen
It pops up a window with a small instruction on how to use the catalog
and there is also a close button. I just adapted it from some elses
script.
2)
You can find some good info. on how to do this sort of thing at:
http://www.webreference.com/javascript/960520/how.html
3)
Hotbot has an example of what you're talking about in their Help Section. I
think we may also use such an approach for our online help.

http://www.hotbot.com

4)
Try :

http://www.lib.unb.ca/Main/Research.html
5)
You can try our document submission system. It uses help windows
that do what you're looking for. Go to our forms page:
http://www-library.lbl.gov/Library/forms/pwo_rk2/

Select form 'A', select a division and use my employee #; 478875.
On the next page you'll see a form with help buttons. Click a
button and another page will pop up.

This is done with JavaScript. This does not work with IE2, works
okay with NS2 but works best with NS3 IE3.

You're welcome to the code if you like. It's a little messy 'cause
all this stuff is generated from CGI scripts, but I've pulled out
the relevant bits.

--------code-------------
<script language=\"JavaScript\">
<!-- Hide code.
var newWin = null;
function openHelpWin(urlVal,targetVal,x,y)
{
   var
opt="toolbar=no,location=no,scrollbars=yes,resizable=yes,directory=yes,wi
dth="+x+",height="+y;

   newWin=window.open(\"\",targetVal,opt);

newWin.location.href=\"http://www-library.lbl.gov/Library/forms/pwo/\"+urlVal
;
}
// Unhide it. -->
</script>


Here's where it's called:

<a href="javascript:openHelpWin('helpfiles/DOE_code.html','helpwin',600,300)">

5)
I've sent as an attachment a set of html pages with the javascript you
asked for.  Its hard to see the function of the javascript unless you've
got the pages involved.  The javascript is below as well.
Diane
<Script>
function linkto(form)
{
   var site=form.projects.selectedIndex;
   if (site==0)
       alert("Please select a Project");
   if (site>=1)
   {

	msgwin=window.open(form.projects.options[site].value,'reports','width=300,heigh
t=300,scrollbars=yes');
	msgwin.focus();
   }
}
</Script>
6)
Maybe uou can use this:
<!-- goes in the head sektion -->
<SCRIPT LANGUAGE="Javascript">
<!--
function showsomething()
{
str = "filename.htm";
smallwin = window.open(str,'SmallWin',

'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizabl
e=1,copyhistory=0,width=200,height=200')
}
//-->
</SCRIPT>

<!--in the body sektion -->
<!-- also support for non javascript browsers -->
<A HREF="filename.htm" onClick="showsomething(); return false">link to
filename</A>






Steve Ryan
Co-ordinator Internet Training          Tel: 61 2 351 5030
University of Sydney Library            Email:s.ryan at library.usyd.edu.au
Fisher Library F03                            Fax: 61 2 3514593
N.S.W. 2006 Australia




More information about the Web4lib mailing list