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...
You can do it two ways depending on what you want to do:
- AJAX, or
- Javascript.
AJAX would be the coolest way to do it, but depends on what content you are trying to auto refresh.
right now, its just a div that i want to refresh. inside that div there is <?php get_weather('91505') ?> ...
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...
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.
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...
I have tried modding some ajax, javascript, etc and no luck...
Can anyone help?
Thank you
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.
it would be a good plugin idea though...