 |
 |
Designing a Widget to Refresh a Web Page Inside It?
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2005
Location: Winnipeg, MB
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
r_u: Would the widget run even if dashboard weren't active?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|