Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5

Thread: refresh a div

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Member #
    23922
    Hi Friends,
    Let me know how can we refresh a div in a page. instead of refreshing the whole page we need to refresh the particular div only.

    Thanks in Advance

  2.  

  3. #2
    WDF Staff RickM's Avatar
    Join Date
    Jun 2010
    Posts
    593
    Member #
    2
    Liked
    16 times
    Moved to the correct forum

  4. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    7
    Member #
    23767
    Use JS Ajax call via innerHTML

  5. #4
    Member JayWood's Avatar
    Join Date
    Oct 2010
    Location
    East Coast U.S.
    Posts
    55
    Member #
    24240
    Well if you want to change that, I'd say you use jQuery via the .html() parameter. Just pass any HTML you want to that parameter.

    With a little more info, I could be of more help. For instance, what is the new data, where is it coming from, and how do you need to update it, via click or automatically?
    Don't forget to Rep people if they've helped you, it's just the right thing to do.
    My Site - JJ's Webs
    My oDesk Profile - Hire me on oDesk
    My Themeforest Profile - Just for you TF people!

  6. #5
    Senior Member paintingtheweb's Avatar
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    128
    Member #
    15503
    just some examples:

    if you're using jQuery:

    Code:
    $(function(){
      //you can put the following code inside whatever event you want to trigger the "refresh"
      $("myDiv").html("<p>This is my new content for my div!</p>");
    });
    w/out jQuery:

    Code:
    //again, within the event that triggers the "refresh"
    document.getElementById("myDiv").innerHTML = "<p>This is my new content for my div!</p>";


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:15 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com