Off Topic
The debt clock started when a friend e-mailed me a years ago and asked how to do a counter like a clock that starts at a specific point. He needed it in Flash so I whipped one together and sent it to him and then realized I could maybe do something worthwhile by putting it out there for people to use. I did.. and it hit myspace and facebook.. and I'm currently seeing about 65,000 views of it each month. I encouraged people to download it and install it on their own servers (it's not sucking too much bandwidth, but they shouldn't have to wait on my server for their page to finish loading..) so I'm not sure how many views it's getting that way.. I know it's being used on quite a few political web sites (both Republicans and Democrats running for Congress for example), in articles, and on some personal web sites.
I don't fuss with the accuracy of it since I figure if they can pull a number like $700,000,000,000 out of thin air just because it's "a really large number" then there's no point in trying to be too accurate on anything based on numbers provided by the same folks. I like to think that over the last few years I've helped a tiny bit to raise awareness of our out of control spending.. I can hope it's not too late to sort things out and maybe someday I'll be able to reverse the clock.
So I swapped out the line between the modem and the wall jack. The lights came back on. I took that phone line and tested it with a phone and it was bad... heh. Always check layer 1 first.
It seems so simple in JavaScript.. you know, check the current size of the browser window and if it's too small then resize it back to a larger size. Simple!
But nothing is simple once Microsoft gets ahold of it, and so this is.
Here are the resources I dug up:
force window min size
Maintain Window aspect ration onResize
Manipulating Windows
So it seems simple enough, and within a few minutes I had the code working when I tested in Firefox. I tested in IE6 on my PC and it worked. Cool enough, that was quick.
Then I tried it on my laptop. It didn't work. Here's the Microsoft reason why..
"Windows blocks these functions by using a script when the mouse button is down. If the mouse button is down, Windows considers the operation to be a drag operation and blocks any move or resize functions. "
So essentially what was happening was the user (me) was dragging the browser window in and out and JavaScript was constantly firing an onResize event. IE was interpreting that as some hacker trick or something I guess and so threw an error and walked away. Wee.
Even though my pc is patched up to service pack 2 and I have IE6 all patched up the laptop apparently has something slightly different in the XP. When I check the version for both IE browsers they're the same. The security settings are the same. I was loading via the same server for both systems. But there's something slightly different with the laptop. I didn't have time to dig around and find exactly what is different because it didn't matter. What mattered was I had two computers running XP SP2 and IE6 with the same version and they were treating my JavaScript differently.
So a solution? There's probably a good one out there somewhere, but I didn't find one.. so here's what I did - added a 200ms timeout so that the last reSizeOuterTo() didn't fire until after the mouse button was released. It might be better to use a try/catch and if that error gets thrown then set a short timeout and try again.. or something.. but I just mashed together code I found like so:
function checkSize(){
var width;
var height;
if(document.layers) {
width = window.innerWidth;
height = window.innerHeight;
} else {
width = document.body.clientWidth;
height = document.body.clientHeight;
}
if((width < 600)||(height < 450)){
setTimeout("resizeOuterTo(600,450)",200);
}
}
function resizeOuterTo(w,h) {
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
top.outerWidth=w;
top.outerHeight=h+40;
} else{
top.resizeTo((w+12),(h+30));
}
}
}
It's not elegant, but did the trick for what I needed.. I'm still looking for a permanent solution, so if you have one please feel free to comment.
also.. just to make sure people know this is kind of futile because some dude with a pimped out Firefox might decide to change this setting:
I’m seeing a rise in trackback spam coming from university domains like these posts http://www.csrd.uiuc.edu/HyperNews/get.cgi/PROMIS/10.html at Center of Supercomputing Research and Development at University of Illinois.
It seems that the spammers are just using these HyperNews systems for redirects by adding an old JavaScript trick to their post. The HyperNews systems that I’ve seen getting hit by this appear to be old, abandoned setups that are not maintained, and don’t filter JavaScript and other nasty tricks out of their posts.
I saw a similar redirect from the HyperNews install at Stanford University last week, reported it, and they’ve removed the redirecting post. I’ll keep reporting them and adding filters but the spammers have more time than I do.

