refreshing html document

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anutosh100
    New Member
    • Mar 2008
    • 8

    refreshing html document

    I want to make an html document.

    Suppose the name of the html document is anu.html.

    What i want is at first it will show "hello anutosh",


    and after 5 sec there will be some other information which will be shown by
    that very same html called anu.html.

    So the refreshment is the main problem.

    any one can tell me how can i remove "hello anutosh" and substitute other information in place of that string in that very same html.

    waiting for your reply.

    Thanks!
  • LorenW
    New Member
    • Mar 2008
    • 7

    #2
    Depending on what you are trying to do, it may not be necessary to reload the page to display the new message in the place of the old one. Can you give more specifics?

    Comment

    • LorenW
      New Member
      • Mar 2008
      • 7

      #3
      I am no expert, but maybe something like this might help:

      Code:
      <script language="JavaScript">
      
          window.setTimeout('runAfterSomeTime()', 5000); // Five seconds
      
          function runAfterSomeTime(){
              document.getElementById('message').innerHTML = "Goodbye my friend."
          }
      
      </script>
      
      <span id="message">Hello Anutosh</span>
      Resources of possible interest:

      Comment

      • anutosh100
        New Member
        • Mar 2008
        • 8

        #4
        Thanks LorenW .Thank you very much.

        Comment

        • LorenW
          New Member
          • Mar 2008
          • 7

          #5
          My pleasure to be able to help. By the way, I have been told since my post to you that the proper way to do the embedded JavaScript script tag is as follows below, so I wanted to share that just incase:

          Code:
          <script type="text/javascript">
          <!--
          
          /* Your code goes here */
          
          // -->
          </script>
          Good luck!

          Comment

          Working...