Wednesday, January 9th, 2008
CNN Politics Election Center
The primaries and caucuses are here, and people want their information. CNN has an Election Center to give you that information, and it has an Ajax flavour this year:
-
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/scripts/prototype.js" type="text/javascript"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/scripts/scriptaculous.js?load=effects" type="text/javascript"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/StorageManager.js" type="text/javascript"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/csiManager.js"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/main.js" type="text/javascript"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/election/politicsSF.js" type="text/javascript"></script>
-
<script src="http://i.l.cnn.net/cnn/.element/js/2.0/election/electionCommon.js" type="text/javascript"></script>
-
<script type="text/javascript" src="http://i.l.cnn.net/cnn/.element/js/2.0/ad_head0.js"></script>
-
<script type="text/javascript" src="http://i.l.cnn.net/cnn/cnn_adspaces/cnn_adspaces.js"></script>
-
<script type="text/javascript" src="http://i.l.cnn.net/cnn/.element/js/2.0/ad_head0.js"></script>
-
<script type="text/javascript" src="http://i.l.cnn.net/cnn/cnn_adspaces/cnn_adspaces.js"></script>
-
Note the duplicate adspaces.js :)
There were features I was hoping to see that I didn't. When the results were coming in it would be nice of them to (maybe using Comet) update the page when new content came in, and updating the time (1 minute ago doesn't make as much sense if it doesn't change).
The use of Ajax itself is subtle throughout. There are lots of in place loading, lightboxes, subtle animations as you go through tabs, and more.













I was playing around with this all of last night. It is pretty impressive. I feel that the ajax on load of a page was kinda unnecessary, but whatever. The page had some great syling and the “drop-downs” were pretty cool
I agree some Comet would have been nice… or even polling the server every few minutes would have been okay for me too because I probably refreshed the page 100 times last night.
Is there any reason why sites liek these dont serve their JavaScript packaged and gzipped?
@RobRobRob – yeah, they should have polled or done something to that effect. Espn scoreboards update every 30 seconds – i think those are flash media servers tough, but it is still done
Somebody removed the duplicate js files… :-)
I thought it was nicely done. I like when they showed some parts of the page immediately, like text, then AJAX loaded the heavier elements like the charts. It’s nice because I could start reading the explanatory text, then check out the charts later. But some of their pages just load the whole thing with AJAX, which is not very helpful.