Houston ! we have a problem :-(

Discussion in 'Javascript' started by Mel, Mar 22, 2005.

  1. Mel

    Mel Guest

    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>
    Mel, Mar 22, 2005
    #1
    1. Advertising

  2. Mel

    Evertjan. Guest

    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)
    Evertjan., Mar 22, 2005
    #2
    1. Advertising

  3. Mel

    Mel Guest

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


    "Evertjan." <> wrote in message
    news:Xns96223B5D5C3Ceejj99@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)
    >
    Mel, Mar 23, 2005
    #3
  4. Mel

    Lee Guest

    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".
    Lee, Mar 23, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. infoTEAM, inc.
    Replies:
    2
    Views:
    551
  2. Guest

    Job offer in Houston, TX

    Guest, Feb 12, 2004, in forum: Java
    Replies:
    1
    Views:
    394
    susith
    Feb 26, 2009
  3. Tom Grills
    Replies:
    1
    Views:
    330
    Gianni Mariani
    Feb 23, 2004
  4. Tom Grills
    Replies:
    0
    Views:
    332
    Tom Grills
    Feb 23, 2004
  5. Tom Grills

    Looking for a C/C++ programmer in Houston

    Tom Grills, Feb 23, 2004, in forum: C Programming
    Replies:
    1
    Views:
    295
    Gianni Mariani
    Feb 23, 2004
Loading...

Share This Page