Houston ! we have a problem :-(

M

Mel

the following code works fine, except that it does not scroll to the bottom.
which is what i really want
can someone help this pooooor soooouuuuullllll
i am a newbeeeee (kind'a)


<a href=# onclick="addtext('Tue Mar 22 2:39:09 PM Eastern Standard Time
2005<BR>');">
<b>HELLO</b></a>

<div id=MyDiv style=height:100;overflow:auto class=normal style="border:1px
CCCCCC solid"></div>

<script>
function addtext(string) {
var c = new Date();
oDiv = document.getElementById("MyDiv");
oDiv.innerHTML = oDiv.innerHTML + string + '<A name=' + c + '></A>';
self.location = "#" + c;
}
</script>
 
E

Evertjan.

Mel wrote on 22 mrt 2005 in comp.lang.javascript:
the following code works fine, except that it does not scroll to the
bottom. which is what i really want
can someone help this pooooor soooouuuuullllll
i am a newbeeeee (kind'a)


<a href=# onclick="addtext('Tue Mar 22 2:39:09 PM Eastern Standard
Time 2005<BR>');">
<b>HELLO</b></a>

<div id=MyDiv style=height:100;overflow:auto class=normal
style="border:1px CCCCCC solid"></div>

<script>
function addtext(string) {
var c = new Date();
oDiv = document.getElementById("MyDiv");
oDiv.innerHTML = oDiv.innerHTML + string + '<A name=' + c +
'></A>'; self.location = "#" + c;
}
</script>

which stands to reason, since location reloads the original page,
where the script is not yet executed.
 
L

Lee

Mel said:
I know it does not work, but the question is can you help ?

He also told you why it doesn't work.

Don't assign a new value to the location object. Assign a new value to
"location.hash".
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top