By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,625 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,625 IT Pros & Developers. It's quick & easy.

Houston ! we have a problem :-(

P: n/a
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>
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2

P: n/a
Mel
I know it does not work, but the question is can you help ?
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn*******************@194.109.133.29...
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.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #3

P: n/a
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".

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.