Document title does not work on web

T

Trevor Lawrence

I posted this question on microsoft.public.scripting.jscript and I got an
reply from a regular to c.l.j. which:
1. Didn't answer the question I asked (last sentence), and
2. Implied that I had posted in the wrong place

Can anyone here help ?

BTW,
Perhaps I asked the wrong question, so I will rephrase it :
What do I have to do so that the header will display the contents of
document.title ?
(By "header" I mean that blue bar at the top which, in IE7, contains the
close button on the far right)

Post is here
=========
I have some JS code to alter the document title to something meaningful when
a picture is displayed. It works locally but not when the site is uploaded
to the web

For example in http://tandcl.homemail.com.au/index.html
<a href="javascript:newWindow('images/display/trevor.jpg','Trevor');">
<img src="images/display/trevor.jpg" alt=""
title='Click to see a larger picture'
style="float:left"
height="100" /></a>

newWindow uses window.open() to open
http://tandcl.homemail.com.au/picture.html in a new window
The call is
window.open('picture.html?picture=images/display/trevor.jpg&amp;caption=Trevor&amp;height=500&amp;width=500','',',width=500,height=575,left=390,top=0')

picture.html calls a JS function getPic() using the parameters picture,
caption, height and width to write the image into an element, change the
document.title and alter the size of the element where the image is written.
Everything appears to work fine, except that the title is not displayed in
the blue bar. Instead it says
http://tandcl.homemail.com.au/?picture=images.display/trevor.jpg&caption=Trevor&height=........
etc

I added alert('document.title= ' + document.title) to the JS and for the
picture mentioned, it alerts
document.title = Trevor

So why is Trevor being passed to document.title but not displayed in the
header?
 
D

David Mark

I posted this question on microsoft.public.scripting.jscript and I got an
reply from a regular to c.l.j. which:
1. Didn't answer the question I asked (last sentence), and

No, it was answered. I'll answer it again I guess.
2. Implied that I had posted in the wrong place

No question, assuming you want a timely and accurate answer.

[snip]
 
J

Jorge

(...)
So why is Trevor being passed to document.title but not displayed in the
header?

Hi Trevor,

In my Mac, some browsers are replacing the title with "Trevor"(1), and
some other (older) browsers (2) are appending it to the window's url
(It's shown, but it's the last word of the window's title). I don't
know why. There might be some kind of (obsolete) convention about the
titles of windows opened with window.open()... ?


(1)Safari 321, Opera 962, FF3, Camino 166, iCab 305.
(2)FF2, NN9, SeaMonkey 1112. Couldn't test IE5, it trows an error.
 
T

The Natural Philosopher

Trevor said:
I posted this question on microsoft.public.scripting.jscript and I got an
reply from a regular to c.l.j. which:
1. Didn't answer the question I asked (last sentence), and
2. Implied that I had posted in the wrong place

Can anyone here help ?

BTW,
Perhaps I asked the wrong question, so I will rephrase it :
What do I have to do so that the header will display the contents of
document.title ?
(By "header" I mean that blue bar at the top which, in IE7, contains the
close button on the far right)

Post is here
=========
I have some JS code to alter the document title to something meaningful when
a picture is displayed. It works locally but not when the site is uploaded
to the web

For example in http://tandcl.homemail.com.au/index.html
<a href="javascript:newWindow('images/display/trevor.jpg','Trevor');">
<img src="images/display/trevor.jpg" alt=""
title='Click to see a larger picture'
style="float:left"
height="100" /></a>

newWindow uses window.open() to open
http://tandcl.homemail.com.au/picture.html in a new window
The call is
window.open('picture.html?picture=images/display/trevor.jpg&amp;caption=Trevor&amp;height=500&amp;width=500','',',width=500,height=575,left=390,top=0')

picture.html calls a JS function getPic() using the parameters picture,
caption, height and width to write the image into an element, change the
document.title and alter the size of the element where the image is written.
Everything appears to work fine, except that the title is not displayed in
the blue bar. Instead it says
http://tandcl.homemail.com.au/?picture=images.display/trevor.jpg&caption=Trevor&height=........
etc

I added alert('document.title= ' + document.title) to the JS and for the
picture mentioned, it alerts
document.title = Trevor

So why is Trevor being passed to document.title but not displayed in the
header?
I suspect this is security thing - anti phishing. With IE7 ..
I.e when using window.open and javascript to set titles, MS has decided
that they will actually show the URL and calling function as well, so
that malicious javascript can't fake a window as easily.
 
S

SAM

Le 12/21/08 1:17 PM, Jorge a écrit :
(1)Safari 321, Opera 962, FF3, Camino 166, iCab 305.

There is an iCab 4
(2)FF2, NN9, SeaMonkey 1112. Couldn't test IE5, it trows an error.

How do you on your Mac run FF2 and FF3 at same time (both together)?
 
D

David Mark

Le 12/21/08 1:17 PM, Jorge a écrit :




There is an iCab 4


How do you on your Mac run FF2 and FF3 at same time (both together)?

It is quite simple on a Mac (as opposed to Windows.) Just install it
in an alternate folder.
 
S

SAM

Le 12/21/08 3:11 PM, David Mark a écrit :
It is quite simple on a Mac (as opposed to Windows.) Just install it
in an alternate folder.

What is an "alternate" folder ? a separate ?
If it is, you think I did try.

My problem is that I don't know how to do to have FF2 automatically
launched with profile #1 while FF3 does the same with profile #2.
(I've already lost a lot of profiles, choosing the wrong at invite)

The common profiles ini file doesn't seem to consider that it's
possible to have several preselected choices in regard of FF's version.
Maybe I missed something?
 
D

David Mark

Le 12/21/08 3:11 PM, David Mark a écrit :



What is an "alternate" folder ? a separate ?
If it is, you think I did try.

My problem is that I don't know how to do to have FF2 automatically
launched with profile #1 while FF3 does the same with profile #2.
(I've already lost a lot of profiles, choosing the wrong at invite)

No idea. Never worried about profiles.

[snip]
 
S

SAM

Le 12/21/08 6:14 PM, Jorge a écrit :
Hi Stephane,

Bonsoir Jorge,
No, they can't run both at the same time.

I'm sorry but both can be launched in same session, or I think it, as it
seemed I saw that (they are still opened at this time).

Each one with its own profile if you want to use theirs own bookmarks
or/and extensions
.... I mean : at least on Mac - as I know nothing about Win -

Cordialement (almost equivalent with "Regards"),
 
E

Eric B. Bednarz

No, they can't run both at the same time.

Yes they can. The following assumes that you put the alternate Firefox
in ‘/Applications/Firefox 2.app’ (or whatever your localized
Applications equivalent would be) and that you use the default bash
shell:

1) open Terminal.app and paste or type

/Applications/Firefox\ 2.app/Contents/MacOS/firefox -CreateProfile FF2

and press enter

2) open .bashrc or .bash_profile, or create one of them if neither exists
and add the line

alias ff2='/Applications/Firefox\ 2.app/Contents/MacOS/firefox -P "FF2" -no-remote'

Save and type in Terminal.app

source .bashrc

(or source .bash_profile, depending on the preceding step) and press
enter.

You can now start Firefox 2 next to your default one form Terminal.app
with the command ‘ff2’.

That’s the quick method, from memory. In case your default Firefox is
confused next time it starts up, launch it with

/Applications/Firefox.app/Contents/MacOS/firefox -P

select the default profile and check ‘Don’t ask at startup’. That should
be all.

Even for oneliners like the above I actually prefer shell scripts that I
put in a directory in my path (you actually need this when you want to
make it an app that you can start from the dock), but the alias saves
about three steps for the basic task at hand. :)
 
S

SAM

Le 12/21/08 11:50 PM, Eric B. Bednarz a écrit :
1) open Terminal.app and paste or type

/Applications/Firefox\ 2.app/Contents/MacOS/firefox -CreateProfile FF2

and press enter

2) open .bashrc or .bash_profile, or create one of them if neither exists
and add the line

alias ff2='/Applications/Firefox\ 2.app/Contents/MacOS/firefox -P "FF2" -no-remote'

where (and how) do I find/create/save this .bashrc
(preferably when I'm on the Finder, not in the Terminal)
Save and type in Terminal.app

source .bashrc

(or source .bash_profile, depending on the preceding step) and press
enter.

You can now start Firefox 2 next to your default one form Terminal.app
with the command ‘ff2’.

That’s the quick method, from memory. In case your default Firefox is
confused next time it starts up, launch it with

/Applications/Firefox.app/Contents/MacOS/firefox -P

select the default profile and check ‘Don’t ask at startup’. That should
be all.

And that it wouldn't be enough (for FF2 and FF3, mine run both together
but need I tell them which profile to use) ?

(the fr navigators's ng is on silent at this moment ... :-/ )
 
E

Eric B. Bednarz

SAM said:
where (and how) do I find/create/save this .bashrc

In your home directory.
(preferably when I'm on the Finder, not in the Terminal)

I have no idea. The finder hides system files, and so do most GUI
apps in their file open menu. I use Emacs as a file manager, so you’d be
better advised by somebody who uses the GUI and hates the shell ;-).

In Terminal.app

ls -al ~/

shows all files in your home directory. You can try

open ~/.bashrc

and

open ~/.bash_profile

If both don’t exist, do

touch ~/.bash_profile

to create it, and then

open ~/.bash_profile

In all likelihood, that will open it with TextEdit.app.
And that it wouldn't be enough (for FF2 and FF3, mine run both
together but need I tell them which profile to use) ?

Sorry doesn’t parse; please rephrase.
In either case you should use different profiles (to avoid continuous
extensions compatibility tests, FF is upgraded messages, etc, and
otherwise I would especially stay away from trying to run both versions
at the same time).
 
T

Trevor Lawrence

Trevor Lawrence said:
I posted this question on microsoft.public.scripting.jscript and I got an
reply from a regular to c.l.j. which:
1. Didn't answer the question I asked (last sentence), and
2. Implied that I had posted in the wrong place

Can anyone here help ?

Thank you Jorge and The Natural Philosopher.

Your replies were helpful
 
S

SAM

Le 12/22/08 1:00 AM, Eric B. Bednarz a écrit :
Sorry doesn’t parse; please rephrase.

I have :
- an old profile with bookmarks.htm and so on in !sqlite
and with extensions in versions compatible with FF2
- a new profile based on sqlite plus extensions for FF3
I launch FF2 with the old profile and FF3 with ne new one.
That seems to be quite OK both running together.
I asked if when launching FF2 I chose "don't ask next time", will FF3 be
launched via the profiles manager or will it pass this step and get the
wrong profile (this of FF2) ?
In either case you should use different profiles (to avoid continuous
extensions compatibility tests, FF is upgraded messages, etc, and
otherwise I would especially stay away from trying to run both versions
at the same time).

Probably I'll get some messages about old versions of extensions in FF2
but it is not because it runs while FF3 runs, it's only because they are
old dated extensions.

I keep by me your lesson about the terminal, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top