Ajax Refresh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • techbytes
    New Member
    • May 2010
    • 36

    #1

    Ajax Refresh

    I Am working in Ajax for inserting values into the database.After the value is inserted,a message showing "Successful ly Inserted" is displayed.

    I want to know whether i can able to refresh the div after few seconds of showing the message .

    Now the message is displayed,I have to refresh the page Manually.

    Give Suggestions.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    suggestions regarding what? displaying the message or deleting the message?

    Comment

    • techbytes
      New Member
      • May 2010
      • 36

      #3
      Originally posted by Dormilich
      suggestions regarding what? displaying the message or deleting the message?
      I donot want delete the message or display the message.

      Iam getting the message "Successful ly Inserted".

      But after few seconds the div should be refreshed.
      I know how to refresh the div.

      I donot konw how to refresh the div after particular time interval.

      This should happen whenever the message is displayed and after few seconds the div should be refreshed.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        does the div contain anything else than the AJAX message?

        Comment

        • mzmishra
          Recognized Expert Contributor
          • Aug 2007
          • 390

          #5
          Originally posted by Dormilich
          does the div contain anything else than the AJAX message?
          set something like
          setTimeout('fun ctionname()',20 00);

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            just a short side-note:

            Code:
            setTimeout('functionname()', 2000);
            is in fact an implicit eval-call ... it is much to prefer to use the API as it is intended which means:

            Code:
            var func = function() {
                // do stuff
            };
            
            window.setTimeout(func, 2000);
            the first parameter is a reference to the declared function while the second is the time in ms to wait before execution of the passed function.

            except of evaluating a JSON-response there should never be a need to use any eval in javascript.

            kind regards

            Comment

            Working...