Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   Internet Discussion (https://www.cableforum.uk/board/forumdisplay.php?f=25)
-   -   JavaScript Code Problem (https://www.cableforum.uk/board/showthread.php?t=2314)

Tricky 01-09-2003 16:13

Java Problem
 
Help, I'm writing a photoalbum in JAVA and need some help...

I want to change the title of the browser window (the remote one) to something more meaningful (like my webspace name)

The code which creates a new window with the image in is:
imgName="photos/st_"+aImage[iImagenum]
imgWindow=window.open(imgName,"imgWin","Width=660, height=510,scrollbars=no,status=yes")
imgWindow.window.status=aText[iImagenum]

I can change the "Status Bar" of the window as in the 3rd line of code above, but I want to change/set the title (Ie. nthellworld.co.uk at the top left of your browser).

Any ideas?:confused:

Tricky 01-09-2003 16:59

Best I could manage but it works!:eek: :eek:

imgName="photos/st_"+aImage[iImagenum]
imgWindow=window.open('','imgWin','height=510,widt h=660,scrollbars=no,status=yes');
imgWindow.document.write('<HTML><HEAD><TITLE>Your Selected Image: '+aImage[iImagenum]+'</TITLE>');
imgWindow.document.write('<LINK REL="stylesheet" HREF="../../../rtstyle_zeddy.css">');
imgWindow.document.write('</HEAD>');
imgWindow.document.write('<BODY>');
imgWindow.document.write("<IMG SRC="+imgName+" </IMG>");
imgWindow.document.write('</BODY></HTML>');
imgWindow.window.status=aText[iImagenum]

philip.j.fry 01-09-2003 17:08

Quote:

Originally posted by Tricky
Help, I'm writing a photoalbum in JAVA and need some help...


Don't you mean Javascript :)

Alan Waddington 01-09-2003 19:48

Code:

<html>
<head><title>Extreme PhotoAlbum</title></head>
<body>
<script language="javascript">
imgWindow=window.open("image0013.jpg","imgWin","Width=660,height=510,scrollbars=no,status

=yes");
imgWindow.document.title="Really interesting picture";
</script>
</body>
</html>

/edit works in IE6, doesn't in Mozilla 1.4 or Nescape 4

Guess it depends whether that's important

Tricky 01-09-2003 21:14

Cheers mate, I was certain that I'd tried the obvious but alas I can't have done - I've stuck with my dodgy code because I've duplicated it in a number of html pages now!!!

Thanks again...:D

Bifta 01-09-2003 22:27

could you not just use document.title ?

edit: should maybe read whole thread before replying :spin:

MadGamer 07-09-2003 09:11

Maybe you should select everthing before you start to copy over to another location

Tricky 07-09-2003 10:18

Quote:

Originally posted by WNA
Maybe you should select everthing before you start to copy over to another location
And translated means?:confused:

Richard M 07-09-2003 11:59

You shouldn't be using IE only JS, try learning the proper way with the DOM:
http://www.w3.org/DOM/

MadGamer 07-09-2003 13:26

Umm err no notepad to be precise:mad: :mad: :mad:


All times are GMT. The time now is 10:01.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum