A gadget JavaScript error is always in the browser - it's never on the
server.

Do you know how to use debugging tools in any browser? That's all you need
to find this. Or just look at the line number in question - if you know
which file it's talking about.

Since this browser didn't tell you which file the error is in, try a
different browser.

I loaded your URL in Chrome and type Ctrl+Shift+I to open the inspector
panel. It showed me this error:

Uncaught SyntaxError: Unexpected token ;

On the far right side of the error message was this text:

ifr:66

That text was underlined like a link, so I tried clicking on it and it took
me to a source code view showing this code:

function new_word(form)
{
    var m=;

and the error message was repeated below this line.

Now you know how to track down an error like this yourself next time. :-)

You can do this in IE8/IE9 as well. Hit F12 after loading your page, and
then reload the page again. In the F12 debugging window, select Console and
it will show you a syntax error with a URL. Click the URL and it will take
you directly to the error - even to the exact position within the line where
something is missing.

BTW, I notice you put the open curly braces in your code on lines by
themselves. I strongly recommend not doing this in JavaScript even if you're
used to it from C and other languages, because it will not work in all
cases. Consider this code:

    function makeObject()
    {
        return
        {
            foo: 'bar'
        }
    }

    var obj = makeObject();
    alert( obj.foo );

That should alert 'bar', yes? Try it and see what it really does...

If you code it like this, it will do what you expect:

    function makeObject() {
        return {
            foo: 'bar'
        }
    }

    var obj = makeObject();
    alert( obj.foo );

It's the position of the curly brace after the return that makes the
difference - and then for consistency it's best to use the same style
everywhere.

-Mike

On Fri, Mar 11, 2011 at 2:13 PM, Viktor Amkhinich <[email protected]>wrote:

> Hi,
> I developed a Web Part that works as a gadget container. All I need to
> make it work, is to copy/paste the gadget's <script...
> There're some gadgets, for example, Hangman, that throw JavaScript
> exceptons. Here's the one from the Hangman:
>
> Message: Syntax error
> Line: 66
> Char: 8
> Code: 0
> URI:
>
> http://www-open-opensocial.googleusercontent.com/gadgets/ifr?url=http%3A%2F%2Forawiz.googlepages.com%2Fhangman.xml&container=open&view=home&lang=all&country=ALL&debug=0&nocache=0&sanitize=0&up_hm_set=&up_hm_skin=&v=54590cde2a81bb0b&source=http%3A%2F%2Fusalnvamkhini1%2Fsites%2FGadgets%2Fdefault.aspx&parent=http%3A%2F%2Fusalnvamkhini1%2Fsites%2FGadgets%2Fdefault.aspx&libs=core%3Acore.io
>
> My questions are:
> 1. Is that my container error, or it happens on the gadget server?
> 2. In any case, how can I handle it?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "iGoogle Developer Forum" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/Google-Gadgets-API?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en.

Reply via email to