AJAX help. Using a link to open tab without reload...

Discussion in 'Programming' started by RJP1, Dec 28, 2009.

  1. #1
    Hi guys,

    I have information tabs on my website. I can open any tab on a particular page by appending "?theTab=3" for example to the URL.

    Is there a way to have a link on these pages that once clicked opens the new link but without a page refresh?

    Thanks for the help. RJP1
     
    RJP1, Dec 28, 2009 IP
  2. anantgupta

    anantgupta Active Member

    Messages:
    212
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    68
    #2
    That are Called Ajax Tabs.
    I am master In that.I can help you out in this.
     
    anantgupta, Dec 28, 2009 IP
  3. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
  4. dollarfish

    dollarfish Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #4
    There is a simple technique it can not called ajax because you don't do requests but only use javascript for it.

    You load the whole content of the tabs but will hide some of the content with style.display = 'none' when you click on particular tab you should change the style of the div tag to style.display = 'block' to show needed content and hide the other one. Changing the style you can use javascript.

    document.getElementById(elementID).style.display = 'none';

    where elementID is html tag ID.
     
    dollarfish, Dec 30, 2009 IP