Loading Page from javascript function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prabhua
    New Member
    • Nov 2006
    • 29

    #1

    Loading Page from javascript function

    Hi,
    can anyone solve my problem?
    i want to load or refresh the page from javascript function?how to do it?
    i.e., on click of anchor tag i am calling javascript function and after some manipulation i want to load same page.
    thanks
    a.prabhu
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by Prabhua
    Hi,
    can anyone solve my problem?
    i want to load or refresh the page from javascript function?how to do it?
    i.e., on click of anchor tag i am calling javascript function and after some manipulation i want to load same page.
    thanks
    a.prabhu
    Moved to Javascript forum .

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      hi ...

      i guess the 'some manipulation' means you want to adapt the page itself with new data that are retrieved from the server depending on the users input ... so 'onclick' that you mentioned ... you may do an ajax call, retrieve the new data and adapt the page to your needs with the new data ...

      have a look at: http://www.w3schools.com/ajax/default.asp

      kind regards ...

      Comment

      • naurus
        New Member
        • Jun 2007
        • 21

        #4
        to just reload:
        Code:
        onclick="window.location.reload()"
        to change the page:
        Code:
        onclick="window.location = 'http://www.google.com/'"
        but to reload just part of the document, use AJAX like in the last post :)

        Comment

        Working...