This gadget:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type="text/css">
body
{
margin: 0;
width: 200px;
height: 200px;
}
</style>
<script type="text/jscript" language="jscript">
document.onreadystatechange = function()
{
System.Gadget.background = "images\\blank.png";
someText = gBackground.addTextObject("Some text", "Arial", 12, "Black", 0, 0);
}
</script>
</head>
<body>
<g:background id="gBackground" style="width:100%; height:100%" />
</body>
</html>
Once put onto my desktop, the gadget shows up with a white background (blank.png
is just a completely white image), but no text appears. Adding text like so works:
<g:background .......>Text here</g:background>
Does anyone have any ideas as to what I'm doing wrong?
What I've tried:
- Change
<script type="text/javascript">
to what you see - Change
<body onload="init()">
andfunction init()
into what you see margin: 0;