Jump to content
Sign in to follow this  

Windows 7 Desktop Gadgets

Recommended Posts

I'm hoping that one of the experts here can help me out.


I've been trying to create a Windows 7 Desktop Gadget for weather (replacing those that are available already - like MSN, the Weather Channel etc.) with one from my local TV station.


There are three "required" files for the gadget to work;






I thought my coding was right but can't get my gadget to work and was hoping that someone could take a look and give me some pointers.


First up - XML File


<?xml version="1.0" encoding="utf-8"?>
<name>4029 Weather</name>
<namespace>Jerry Wever</namespace>
<author name="Jerry Wever">
<info url="http://www.4029tv.com/weather/grid.html#HEARSTWX=http%3A//www.4029tv.com/weather/1666998/media.html%3Fqs%3D%3Bref%3D/weather/17386374/media.html%3Blongname%3D7%2520Day" text="40/29 Weather"/>
<logo src="logo.png"/>
<copyright>© 2010</copyright>
<description>Channel 40/29 Weather Gadget</description>
<icon height="48" width="48" src="icon.png"/>
<host name="sidebar">
<base type="HTML" apiVersion="1.0.0" src="4029 Weather.html"/>
<platform minPlatformVersion="1.0"/>
<defaultImage src="http://images.ibsys.com/fts/images/weather/auto/7day_nwa_120x90.jpg"/>


And the HTML file;


<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
<html xmlns=http://www.4029tv.com/weather/grid.html#HEARSTWX=http%3A//www.4029tv.com/weather/1666998/media.html%3Fqs%3D%3Bref%3D/weather/17386374/media.html%3Blongname%3D7%2520Day/xhtml”> <head> <title></title> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8” />
<link href=”style.css” rel=”stylesheet” type=”text/css” />
<script src=”local.js” type=”text/javascript”></script>
<script src=”gadget.js” type=”text/javascript”></script>
</head> <body> <div id=”gadget” class=”gadget”></div> </body>


Last the JS file;


function pageLoad() { window.detachEvent(“onload”, pageLoad);
window.attachEvent(“onunload”, pageUnload); //page initalization here } function
pageUnload() { window.detachEvent(“onunload”, pageUnload); //gadget is closing, clean
up } window.attachEvent(“onload”, pageLoad);


Essentially the gadget I'm designing would call the 40/29 weather website and display real time temperatures, forecast etc. for my local weather. At least that's the end goal :)

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...