Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Designing a Widget to Refresh a Web Page Inside It?

Designing a Widget to Refresh a Web Page Inside It?
Thread Tools
Professional Poster
Join Date: Jul 2005
Location: Winnipeg, MB
Status: Offline
Reply With Quote
Jan 11, 2006, 04:55 PM
 
OK, my school which unfortunately I'm back at, has some network guys that I swear are a lil bit... off... anyway, they used to have the world's worst proxy server set up that would only let things go through on port 8080, that was awful.
This year they grew a brain and are allowing users to do basically most things you could want to do on a campus network, though to stay conneccted to the internet you have to leave a web page of the school home page open that refreshed to keep the connection alive, every 3 minutes.

Anyway so all that goes to say, I've been keeping the window in a safari tab, but it's a bit annoying, so I was thinking perhaps I could create a widget that would run in the background that would load the page that we wouldn't have to see, and I could give it to the other Mac users on campus .

So the first question is, can you have dashboard widgets continue to work and do things even when dashboard isn't active.
And second can anyone point me to a tutorial that would give me a hand working things out?
     
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Jan 11, 2006, 06:30 PM
 
yes, you can do it easily.

a widget is just a web page.

you could set your widget up with an ajax request to the school's home page. it'll save you from downloading images. every so often.

but to be quick and dirty:

I don't use iframes, but I think this is the syntax:
<iframe.src="your.school.url" id="myiframe"></iframe>

js would be along the lines of :

window.onload = refresh;
function refresh() {
var f = document.getElementById("myiframe");
f.src = "your.school.url";
window.setTimeout(refresh, 120000); //number is in milliseconds, 2 minutes to be safe
}
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jan 14, 2006, 04:56 PM
 
Tell us how this goes Salty. I'd like to hear the outcome.
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jan 14, 2006, 06:51 PM
 
r_u: Would the widget run even if dashboard weren't active?
     
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Jan 15, 2006, 08:38 AM
 
Yes, widgets do indeed run when they aren't active.

There are special methods that you have to call to pause the widget when Dashboard is in the background and then to start it back up again.

Though Apple might 'fix' that behavior. The widget environment is poorly implemented currently.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:47 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2