Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Meta refresh AND a bookmark 1

Status
Not open for further replies.

AlaskanDad

Programmer
Mar 1, 2002
188
US
I've had great luck with an automatic refreshing Meta tag:

Code:
	<meta HTTP-EQUIV="Refresh" CONTENT="<%Response.Write Refresher%>; URL=?room_id=<%=request("room_id")%>&user_id=<%=request("user_id")%>&domain_id=<%=request("domain_id")%>">

This is used for a chat room where I continue to have the chatwindow refreshed every five seconds. However, when I try to use the following Meta tag (note the #Latest at the end):
Code:
	<meta HTTP-EQUIV="Refresh" CONTENT="<%Response.Write Refresher%>; URL=?room_id=<%=request("room_id")%>&user_id=<%=request("user_id")%>&domain_id=<%=request("domain_id")%>#Latest">

It only works once. In other words, it makes it to the <a href="Latest"> tag I have at the end of the text, but it doesn't refresh again.

Any ideas on how to use the first Meta tag and scroll to the end of the text (it's in a scrollable window) another way?

Thanks,
Rob
 
It's difficult to pick out what's actually being sent from the server-side commands (asp? php?). Fire up your page, do a "view source" on the page in question and cut& paste the meta tag in question - maybe it will be more obvious what's going on.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Here is what the first code looks like:

Code:
<meta HTTP-EQUIV="Refresh" CONTENT="5; URL=?room_id=1&user_id=376&domain_id=1">

Here's the second one:
Code:
<meta HTTP-EQUIV="Refresh" CONTENT="5; URL=?room_id=1&user_id=376&domain_id=1#Latest">

If I don't use hash mark for the first one, is there another way I can move the focus to the bottom of the scrolled, lengthy text?

Thanks,
Rob
 
Javascript an option?

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Sure! Why not?

You'll have to walk me through it as I know only the first thing about Javascript and that's about it.

:)
 
Code:
<body onload="setTimeout('document.anchors[\'a\'].focus();', 5000);">
onload <-- executes the code when the page loads
setTimeout <-- executes the code after a period of time
document.anchors[\'a\'] <-- finds an anchor with id "a"
.focus() <-- focuses on it
5000 <-- execute after 5000 milliseconds
There is probably a better way, but I don't feel much like looking for it.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
This is the body tag I entered after your suggestion:

Code:
<BODY topmargin=0 leftmargin=5 rightmargin=5 onload="setTimeout('document.anchors[\'Latest\'].focus();', 1000);">

The target is the following anchor:
Code:
<a name="Latest" id="Latest">

As written, it's not working the way I want. The refresh just seems to have its focus on the top of the list of text leaving the bottom (where the anchor is) hidden below only accessible by scrolling.

Am I missing something?
-Rob
 
How about
Code:
<BODY topmargin=0 leftmargin=5 rightmargin=5 onload="setTimeout('document.anchors[\'Latest\'].focus();scrollBy(0, screen.height-240);', 1000);">

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
I see no scrolling on that page.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Seems to work fine for me ... I can't type in the field, or I would tell you there.

It's kinda annoying though.

What browser are you using?

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
I'm using IE.

You weren't able to type in the pink field at the bottom next to the Send button? What happened?
 
And the reason that it doesn't work on my page is because I am using FireFox.

document.all is IE-specific; you should change all of the "document.all.etc" to "document.getElementById('etc')" for compatibility.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Thanks for the 'document.all' change suggestion. I just made it.
 
I swapped out the "["'s with "("'s and it worked perfectly!

Thanks! Star for you!
 
odd...
Well, that's good. Glad to be of service.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top