Forums

refreshing specific content independently... (9 posts)

  1. Kahil
    Member
    Posted 3 years ago #

    Is there any way for me to automatically refresh a div without having to reload the whole page? I've been looking all over for a plugin that may do this, but no luck. I've found plugins that do this, but I have no idea how to mod them for what I want to do...

    Thanks in advance...

  2. peiqinglong
    Member
    Posted 3 years ago #

    You can do it two ways depending on what you want to do:

    1. AJAX, or
    2. Javascript.

    AJAX would be the coolest way to do it, but depends on what content you are trying to auto refresh.

  3. Kahil
    Member
    Posted 3 years ago #

    right now, its just a div that i want to refresh. inside that div there is <?php get_weather('91505') ?> ...

  4. Kahil
    Member
    Posted 3 years ago #

    I did a search for javascript and AJAX but I couldn't figure it out on how to use it for what I want to do...

  5. peiqinglong
    Member
    Posted 3 years ago #

    How good are you with programing? I know this link doesn't 100% apply, but the idea and concept might help:

    http://www.alistapart.com/articles/userproofingajax

    My skills with AJAX is very limited. I've been wanting to learn, so sorry I can't help you much right now. But concept wise, if you implement an AJAX for that weather thing, you set the AJAX code to refresh at set intervals. Essentially AJAX is javascript, so scripting something such as interval refreshing shouldn't be too difficult. That way only that part of your page will refresh.

  6. Kahil
    Member
    Posted 3 years ago #

    Thank you...

    That link doesn't really tell you a whole lot other than the very limited basics of what AJAX is.

    I've tried looking at other AJAX plugins out there and they all have very specific things in them that let the plugin function. I can't for the life of me find out how to simply make a div or any other section refresh...

  7. Kahil
    Member
    Posted 3 years ago #

    I have tried modding some ajax, javascript, etc and no luck...

    Can anyone help?

    Thank you

  8. Otto42
    Moderator
    Posted 3 years ago #

    It would be an extensive modification. You'd have to make something that served up the content of that div specifically (instead of it just being embedded into the page) and then have javascript/AJAX which would retrieve that info and update the page.

    In other words, it's not a "simple" thing and will take some good programming knowledge. It's not something that you could simply flip a switch to enable.

  9. Kahil
    Member
    Posted 3 years ago #

    it would be a good plugin idea though...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags