Simple widget programming question!

Discussion in 'Mac Programming' started by allegutta, Mar 30, 2010.

  1. allegutta macrumors newbie

    Joined:
    Mar 30, 2010
    #1
    Hi!

    Im new to programming dashboard widgets.

    I am making a simple widget just to learn how to make widgets, but I need some help with programming a button.

    I want the program to write something on the screen when I push the button.


    my code:



    <html>
    <head>

    <script type="text/javascript">
    function = test(){
    document.write("test");
    }
    </script>

    </head>
    <body>

    <input type="button" onclick="test()" value="Write test!">

    </body>
    </html>


    The problem is that the widget closes when I press the button.

    Does anyone know how to fix this?

    Regards allegutta!
     
  2. Nsutton macrumors member

    Nsutton

    Joined:
    Dec 29, 2009
    Location:
    6 Feet Under
    #2
    Im just learning java but if i remember correctly...

    The program terminates after it completes it's task so you need to set up an additional task like "press enter" so it doesn't close.

    I'm just learning so i dont know how to write it, so sorry if i wasn't any help.
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    This has absolutely, 100% nothing to do with Java at all.
     

Share This Page