Mac WebView Reresh

wgshiver

macrumors newbie
Original poster
Jul 6, 2011
6
0
Alright here is the problem I am having. I have a WebView coming up when the program loads. It loads the web page the first time just fine. When I try to refresh the page or reload it, it does nothing.

Now if I create a button and put it on the window and link that to my function that refreshes the web page it works perfectly.

What I need to do though is have the webpage refresh automatically at a certain time. There is a timer that goes off every 15 seconds. After 15 seconds it does a JSON request with a hash mark. If the hash mark it sends is different than the hash mark it receives back it needs to do a refresh of the content because that means there is new content to be loaded.

This is a digital signage application if that helps. The whole idea is the Mac player checks for new content and if its there then it refreshes the web page.

Is there a particular function of the WebView that I need to be calling. I tried the reload function but again it works fine if called with the click of a button. But if I try to call it through code it does nothing.
 

wgshiver

macrumors newbie
Original poster
Jul 6, 2011
6
0
Got it fixed. I'm not sure exactly what I had wrong or what I did to fix it. I just kept changing things until it worked.
 

WhateverIfeel

macrumors newbie
Jul 28, 2009
4
0
Hi!

Would you care to share how you did the automatic reloading? I am also in need of having a WebView reload its content after a JSON request, however I cannot get the reloading part to work.

Greatly appreciated!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.