output buffering w/ browser tracking?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

output buffering w/ browser tracking?

Post by malcolmboston »

im using output buffering to basically traverse through a long loop which takes an age to complete

ive come to the conclusion i need to use OB so...

all thats working nicely however i would like the browser to go to the bottom result at every reload, im guessing i need to use an anchor tag but am unsure on how to implement it in this situation...

any ideas guys?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

You could try javascript using document.elementID.scrollintoview(false);
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

errr actually I think you could leave out the false part
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

any non-js implementations, i need to keep this light
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

JS is the only method I can think of for manipulating a browser view. An anchor tag might work if set at the bottom of the page - you should set up a quick test, maybe loop through a few dozen lines of text, append anchor, print to browser - see what happens.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I just did something like this... it appears to be pretty "light"
I also have a barbaric knowledge of javascript, so there's probably a better way to do it.

Code: Select all

<html>
<head>
<title>Test</title>
</head>
<body>
<div id="scroll">
<?php


for($i=0;$i<1000;$i++){
	echo $i."<br />";
	usleep(100000);		//	added just to make the auto scroll look better
	?>
	
	<script type="text/javascript">
	document.getElementById('scroll').scrollIntoView(false);
	</script>
	
	<?php
}

?>
</div>
</body>
</html>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply