Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 625329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:17:51+00:00 2026-05-13T19:17:51+00:00

I’ve been working on creating a Windows Desktop Gadget. I can create HTML elements

  • 0

I’ve been working on creating a Windows Desktop Gadget. I can create HTML elements I want with document.createElement. I can set their attributes and I can get those attributes after setting them, but anything I do to modify the document just fails completely silently. I’m not seeing any errors at all, but the gadget just doesn’t change. Even something as simple as document.body.innerHTML = "asdf"; does absolutely nothing. The same code in IE8 works perfectly fine. What am I missing here?

gadget.xml:

<?xml version="2.0" encoding="utf-8" ?>
<gadget>
<name>Citrix Logon Controller</name>
<version>0.1</version>
<author name="Brian G. Shacklett">
    <info url="http://digital-traffic.net" />
</author>
<copyright>&#169; Brian G. Shacklett</copyright>
<description>Controls Citrix Logons.</description>
<hosts>
    <host name="sidebar">
        <base type="HTML" apiVersion="1.0.0" src="gadget.html" />
        <permissions>Full</permissions>
        <platform minPlatformVersion="1.0" />
    </host>
</hosts>
</gadget>

HTML:

<html>
    <head>
    <title>Citrix Manager</title>
    <script type="text/javascript">
        debugger;
    </script>
    <script src="scripts/debug.js" type="text/javascript"></script>
    <script src="scripts/gadget.js" type="text/javascript"></script>
    <script src="scripts/util.js" type="text/javascript"></script>
    <link type="text/css" rel="stylesheet" href="styles/gadget.css" />
</head>

<body >
    <div id="header"><h1>Citrix Manager</h1></div>
    <div id="mainContent">
        <a href="#" onClick="window.location.reload()">reload</a><br />
        <a href="#" onClick="testFunction();">New Server</a>
    </div>
</body>
</html>

gadget.js:

function testFunction()
{
document.body.innerHTML = "asdf";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:17:52+00:00Added an answer on May 13, 2026 at 7:17 pm

    Your code looks fine, and I have used innerHTML and link onclicks just fine many times. I would check two things.

    Directly above your document.body.innerHTML = "asdf"; line, put window.prompt("","");. This will allow you to verify the function is even being called:

    function testFunction() 
    {
        window.prompt("", "");
        // window.prompt("", document.body.innerHTML);    // before
        document.body.innerHTML = "asdf";
        // window.prompt("", document.body.innerHTML);    // after
    } 
    

    You can also add some before/after prompts to give you the value of innerHTML (see commented code).

    Secondly, I would check for any transitions you might be using. In Vista System.Gadget.beginTransition() will lock the appearance of the gadget until System.Gadget.endTransition() is called. If an error is thrown in between these two functions, the endTransition() is never called and the gadget will locked up.

    System.Gadget.beginTransition();
    blah = blah.blah.blah.blah;         // "blah" is null or not an object
    System.Gadget.endTransition(System.Gadget.TransitionType.morph, 1.0);
    

    It’s always safest to use a try/catch around what’s in between. Other than that I can’t say what might be causing your DOM issues, but my first suggestion (the prompt) might give you an idea of what the problem is.


    UPDATE

    Should have spotted this before. You need to cancel the default action, using return false;, of the link click:

       <a href="#" onClick="testFunction(); return false;">New Server</a> 
    

    After your innerHTML function is run, the page is navigated to “#”. I didn’t think this would be a problem, since # usually takes you to a page anchor without reloading but it looks like this is the cause of the problem here. Fully tested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.