Author Topic: Refresh iframe in WordPress?  (Read 17149 times)

pjrainbow

  • Gentle Breeze
  • **
  • Posts: 12
    • IENGLAND642
  • Station Details: Aercus WS3083, iMac running Mavericks with 16GB memory
Refresh iframe in WordPress?
« on: April 16, 2014, 07:03:29 AM »
Hello! This is my first post so please be gentle. :-)

I'm the new owner of an Aercus WS3083, Weather Cat software (of course!), an iMac and I'm cobbling together a weather website in WordPress.  Thanks to all the info from you good people on this site it's going okay.  I'm not using any specific template but pulling in Weather Cat tags to sections of my wordpress template using iframes.  So far so good.  What I would very much like to do is to have the iframe refresh - not the whole page.  I've searched high and low for a bit of code that would make this happen but no luck so far.  Any ideas?

Thanks in anticipation.

Paula

wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Refresh iframe in WordPress?
« Reply #1 on: April 16, 2014, 11:52:00 AM »
Welcome aboard!

I am not coding in WordPress, but maybe this one can hall a bit: http://stackoverflow.com/questions/13928746/refresh-iframe-with-wordpress-3-5

Cheers,
Reinhard
Reinhard


pjrainbow

  • Gentle Breeze
  • **
  • Posts: 12
    • IENGLAND642
  • Station Details: Aercus WS3083, iMac running Mavericks with 16GB memory
Re: Refresh iframe in WordPress?
« Reply #2 on: April 16, 2014, 01:40:22 PM »
Thank you, Reinhard.

I had fiddled about with that one and couldn't get it to work..but I did get something else to work!  In case anyone else is struggling I named the iframe 'curtemp' and used this code in the head:

<script> window.onload = function(){
setInterval(function(){
    parent.frames['curtemp'].location.href = "http://www.example.com/test_temp.html";
},15000);} </script>

and it's refreshing <does a little dance>

Thanks for your help and the welcome  :)

Paula


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Refresh iframe in WordPress?
« Reply #3 on: April 16, 2014, 03:43:16 PM »
and it's refreshing <does a little dance>

Paula:

Welcome to the WeatherCat Forum and it is brilliant to see you dancing today!
Blick


wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Refresh iframe in WordPress?
« Reply #4 on: April 16, 2014, 04:18:12 PM »
Thank you, Reinhard.
...
and it's refreshing <does a little dance>
...
Thanks for your help and the welcome  :)

Nice that you got it working! And - as Blicj11 mentioned - nice to see you dancing!  ;D

Cheers,
Reinhard
Reinhard


pjrainbow

  • Gentle Breeze
  • **
  • Posts: 12
    • IENGLAND642
  • Station Details: Aercus WS3083, iMac running Mavericks with 16GB memory
Re: Refresh iframe in WordPress?
« Reply #5 on: April 16, 2014, 06:59:35 PM »
Thanks guys!

Just to add to this, I was a teeny bit premature doing that jig because although one iframe refreshed perfectly it didn't work with multiple iframes, and what good is one iframe to anyone??  Ideally I wanted multiple iframes to refresh at different intervals but this is the nearest I've got:

I put this code in the header:

<script type="text/javascript"><!--
// set your interval in milliseconds
var reloadInterval = 15000;
// this will run when the document is fully loaded
function init() {
setTimeout('reload()',reloadInterval);
}
// this reloads the iframe, and triggers the next reload interval
function reload() {
var iframes = document.getElementsByTagName('iframe');
if (!iframes) return false;
for(var i=0; i<iframes.length; i++)
iframes.src = iframes.src;
setTimeout('reload()',reloadInterval);
}
// load the init() function when the page is fully loaded
window.onload = init;
--></script>

This works very well on multiple frames but they all refresh together.  It will do for now unless anyone else has a better solution :-)

Paula

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
What's your opinion of WordPress? (Re: Refresh iframe in WordPress?)
« Reply #6 on: April 16, 2014, 10:09:49 PM »
Hi Paula,

Well, let me join in the chorus . . .

Welcome to the WeatherCat forum! 

Hello! This is my first post so please be gentle. :-)

Well it may be your first post, you mention something that I want to pick your brain about a little!

I've got another subject that may need its own dedicated website in a hurry.  I noticed that the WeatherCat main website: http://trixology.com/ has been done up in WordPress and that has turned out very nicely for the developer of WeatherCat: Stuart Ball.

On the other hand, just what you have posted suggests that getting WeatherCat to generate data for Word Press looks plenty complicated!

What is your opinion of WordPress as a website development environment for something slightly more sophisticated than a blogging environment? 

I see that large thick books have been written on how to use WordPress.  Is WordPress trading the "wild and woolly" can of worms of general web development for something almost as treacherous? . . . 

Or is WordPress really a pleasant and relatively easy to use environment so long as you don't try to get too far beyond its basic format and style?  [computer]

Curious minds would like to know!

Cheers, Edouard  [cheers1]

pjrainbow

  • Gentle Breeze
  • **
  • Posts: 12
    • IENGLAND642
  • Station Details: Aercus WS3083, iMac running Mavericks with 16GB memory
Re: Refresh iframe in WordPress?
« Reply #7 on: April 17, 2014, 05:39:24 AM »
Hi Edouard,

Thank you for the welcome  :)  This seems like a lovely, friendly and helpful forum - what a treat!

I'm more than happy to help with your WordPress questions.  I've used Wordpress since around 2003 (when it was called b2!) so we've got some history together! 

Recently I put together a website for a charity using WP and during that process attended a meeting with a professional design company of some considerable experience who were advising the charity's board on the best approach to web design.  When the design consultant was asked if WP was a suitable environment (I held my breath!) she said, "Oh yes, perfect. It's the ONLY environment we use with our sites." 

So in a nutshell, yes a great environment to build some very sophisticated sites.  If you google 'best Wordpress sites' you'll find establishments like Reuters use WP.  It is much more of a content management system than a pure blogging engine these days.

Here's a couple of my own sites; www.rainbowfamily.co.uk. is more of a traditional site although it has a static front page to disguise my horribly inconsistent blogging.  The other one looks far less like a blog http://one-name-study.co.uk/rainbow/.
One of WP's great strengths is its longevity and the massive amount of documentation to solve almost any problem (including refreshing damn iframes!) but the flip side is that the sheer amount of information can be confusing.  One tip when you're searching for WP answers is to use google's options to search within a time frame, ie the last year only, as WP has changed so much and older solutions may no longer be appropriate.

I want use a fancy theme with all sorts of bells and whistles for my new weather site and pull in each data segment separately which is why it's been a bit more complicated than normal, working out how to format and working with the completely unfamiliar Weather Cat. But don't be put off by me, WP has got more straightforward than ever to use recently.  Give it a go and do shout out if I can be of any help :-)

Paula

ps I'm talking about wordpress.org the self installed WP rather than Wordpress.com the hosted variety.










Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Refresh iframe in WordPress?
« Reply #8 on: April 17, 2014, 05:18:08 PM »
ps I'm talking about wordpress.org the self installed WP rather than Wordpress.com the hosted variety.

Edouard, I agree with Paula. I use the WordPress engine (hosted variety) for the website I maintain for our mountain subdivision and I love it. It's simple to learn and quite flexible in what it allows you to do. It's definitely not just for bloggers.
Blick


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Sad digression from your problem. (Re: Refresh iframe in WordPress?)
« Reply #9 on: April 17, 2014, 09:16:13 PM »
Hi Paula, Blick, and WeatherCat fans,

Thank you for the welcome  :)  This seems like a lovely, friendly and helpful forum - what a treat!

Glad you feel that way!  That is certainly the intention!  [computer]

So in a nutshell, yes a great environment to build some very sophisticated sites.

Edouard, I agree with Paula. I use the WordPress engine (hosted variety) for the website I maintain for our mountain subdivision and I love it. It's simple to learn and quite flexible in what it allows you to do. It's definitely not just for bloggers.

Thanks!  Both your comments are encouraging and echos what our fearless leader (Stuart Ball, WeatherCat developer) has told me.

Let me quickly explain my predicament.  WeatherCat forum regulars know that I have been trying to bring back to life a 1965 Buick Special Station wagon that we bought second-hand in 1968 (when I was 7 and here is the photo to prove it:)



There is some more information on my trusty wagon here:

http://athena.trixology.com/index.php?topic=392.0

Alas the restoration hasn't been going very well.  In particular, I had a custom engine built by specialist in Minnesota when I live thousands of miles away in California.  Unfortunately, the engine hasn't been working as promised and the latest disaster is the discovery of a lot of metal debris in the oil pan.  At least one bearing is failing.  So the engine will have to be taken apart, the problems corrected, and everything put back together again.

I have been arguing with the engine builder for months and this is the final straw.  I've decided to send the engine to someone else with an even better reputation to fix the damage (yes, I should have gone with those other guys all along! )

However, there is an unpleasant side effect of this dispute.  The engine builder who built my wagon's engine also is the founder of the largest discussion forum for fellows restoring classic Buicks.  My dispute with the engine builder is likely to cut me off from that resource.  Along the way, I have contributed a lot of "How-to" information about working on my particular Buick to this forum.  All my contributions are in jeopardy in their present location on the web.

Which finally explains to my question.   I may need to put up a web resource site of my own regarding my trusty wagon and I was considering using WordPress as the environment to do this in.

So thanks for the recommendations!

I'm more than happy to help with your WordPress questions.  I've used Wordpress since around 2003 (when it was called b2!) so we've got some history together! 

Well thanks!  I may be looking for some advice in the not too distant future!

Cheers, Edouard  [cheers1]

P.S. Sorry for hijacking your thread!  :-[  Where you able to get WeatherCat to successfully communicate with WordPress?

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Hi Paula and WeatherCat fans,

I had fiddled about with that one and couldn't get it to work..but I did get something else to work!  In case anyone else is struggling I named the iframe 'curtemp' and used this code in the head:

<script> window.onload = function(){
setInterval(function(){
    parent.frames['curtemp'].location.href = "http://www.example.com/test_temp.html";
},15000);} </script>

Apologies again for hijacking the thread and just want to make sure - so is your WordPress site now working as you desire with WeatherCat data displayed as you want it?

I'm still not ready to take on a WordPress project just yet.  but if I do . . . I would definitely want to display some weather data on the site!

Thus I continue to be curious!

Cheers, Edouard  [cheers1]

pjrainbow

  • Gentle Breeze
  • **
  • Posts: 12
    • IENGLAND642
  • Station Details: Aercus WS3083, iMac running Mavericks with 16GB memory
Re: Refresh iframe in WordPress?
« Reply #11 on: April 20, 2014, 04:26:46 PM »
Hi Edouard,
No apology necessary :-)  Your car project looks interesting but I'm sorry you've had all the stress - hopefully you've already grabbed your contributions from the site and stored them away safely in readiness for your own site?  Have you considered a wiki?  I've never put one together myself but the kind of information you're likely to have accumulated sounds like it might suit a wiki. 

Sorry if I'm going off topic here...back to weather sites :-)

I've been busy with other stuff so haven't have much time over the past couple of days but here's the beginnings:

http://paulajay.com/weather/

I'm unsure about the cloud video as it may be slow to load (but I do love those clouds!).  Just a simple page at the moment but this is the kind of style I'm going for and I'll expand on it as time goes by.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks for satisfying my curiosity! (Re: Refresh iframe in WordPress?)
« Reply #12 on: April 20, 2014, 10:26:21 PM »
Hi Paula and WeatherCat Word-Pressers!  [biggrin]

No apology necessary :-)  Your car project looks interesting but I'm sorry you've had all the stress

Thanks for the sympathy - alas, as well all know - hindsight is always 20/20!  :-[

- hopefully you've already grabbed your contributions from the site and stored them away safely in readiness for your own site?  Have you considered a wiki?  I've never put one together myself but the kind of information you're likely to have accumulated sounds like it might suit a wiki. 

Hmm, Actually I tried to pitch a Wiki to the classic community and - lost!

However, that is an excuse to remind everybody that we have a Wiki for WeatherCat:

http://wiki.trixology.com/index.php/Main_Page

Sorry if I'm going off topic here...back to weather sites :-)

I've been busy with other stuff so haven't have much time over the past couple of days but here's the beginnings:

http://paulajay.com/weather/

I'm unsure about the cloud video as it may be slow to load (but I do love those clouds!).  Just a simple page at the moment but this is the kind of style I'm going for and I'll expand on it as time goes by.

THANKS! I was very curious to see how WeatherCat tags would look on a WordPress site.  Even your simple demonstration page shows all the promise of leveraging the power of WordPress while allowing you to take advantage of all the information that WeatherCat can deliver to the web.  So in short . . . . this is really cool!!

Please do keep us posted on your progress!  I have a feeling that this might help all sorts of WeatherCat users who want a personalized weather website but find traditional HTML too intimidating.

Thanks again!

Cheers, Edouard  [cheers1]

Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Refresh iframe in WordPress?
« Reply #13 on: April 20, 2014, 10:42:31 PM »
I'm unsure about the cloud video as it may be slow to load (but I do love those clouds!).  Just a simple page at the moment but this is the kind of style I'm going for and I'll expand on it as time goes by.
I looked at your site; nice beginning. As I was poking around for a minute, suddenly there were clouds! So it did load slow, but the effect is very cool.
Blick


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Sad digression from your problem. (Re: Refresh iframe in WordPress?)
« Reply #14 on: April 20, 2014, 10:44:51 PM »
WeatherCat forum regulars know that I have been trying to bring back to life a 1965 Buick Special Station wagon that we bought second-hand in 1968 (when I was 7 and here is the photo to prove it:)

Nice photo Edouard. And the car looks exactly the same after all these years. Must be magic.
Blick