/    Sign up×
Community /Pin to ProfileBookmark

title tag question

i’m using a javascript code to open my photographs in a new window, size specific. nothing new there. but, i would like to have the title tag in the popup to be specific to the name of the photograph opening in it. is there a way to use javascript to customize the title tag to be specific to the photo opening in it?

thanks!

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JAug 26.2006 — Cannot be more specific without seeing your code but basically try

windowHandle.document.title=newTitle
Copy linkTweet thisAlerts:
@DelReySuckaauthorAug 26.2006 — well, in the page with the thumbnail, it calls the popup page with this script:

[CODE]
<A HREF="javascript:PopupPic('Images/thepicture.jpg')" TARGET="_self">[/CODE]


the page that is opened up is in full below. but the title is just standard. i sould like to just have in it "thepicture.jpg." perhaps picUrl, but without the entire path, you know? the popup page code:

[CODE]<HTML>
<HEAD>
<TITLE>needs to be "thepicture.jpg"</TITLE>
<script language='javascript'>
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};
</script>
</HEAD>
<BODY bgcolor="#CC3366" onload='FitPic();' topmargin="0"

marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + picUrl + "' border=0>" );
</script>
</BODY>
</HTML>[/CODE]
Copy linkTweet thisAlerts:
@Mr_JAug 26.2006 — Give the following a try, if it does not work then post the code for function PopupPic

[code=php]<HTML>
<HEAD>
<TITLE>needs to be "thepicture.jpg"</TITLE>
<script language='javascript'>
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() {

document.title=picUrl.substring(picUrl.lastIndexOf("/")+1,picUrl.length)


iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};

</script>
</HEAD>
<BODY bgcolor="#CC3366" onload='FitPic();' topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + picUrl + "' border=0>" );
</script>
</BODY>
</HTML>[/code]
Copy linkTweet thisAlerts:
@DelReySuckaauthorAug 26.2006 — first, apologies for not posting the popup script:

[CODE]<script language="JavaScript">

function PopupPic(sPicURL) {
window.open( "popup.htm?"+sPicURL, "",

"resizable=0,HEIGHT=200,WIDTH=200");
}

</script>[/CODE]


and, your string worked. thank you kindly. one thing, though, and it may seem anal retentave, but the title tag still shows: "file:// " on the left and "mozilla" on the right. love mozilla, but the logo is already up. is there a way to kill the two of these blighty blahs from the title for sheer aesthetic sake?

regardless, thank you again.
Copy linkTweet thisAlerts:
@Mr_JAug 27.2006 — Instead of a popup why not try a div, something like this example

www.huntingground.freeserve.co.uk/imagery/img_gal1.htm
×

Success!

Help @DelReySucka spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...