cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1010
Views
5
Helpful
2
Replies

syntaxerror function statement requires a name

Astaroth_666
Level 1
Level 1

Hi,

I'm trying to make a simple Gadget based on the Embeded WebApp Sample Gadget but I'm getting a syntaxerror, function statement requires a name

Here is the code of the Gadget:

var finesse = finesse || {};

/** @namespace */

finesse.modules = finesse.modules || {};

finesse.modules.EmbeddedWebGadget = (function($)

{

    /** @scope finesse.modules.EmbeddedWebGadget */

    return

    {

        init: function ( urlToLoad, contentID, iframeID )

        {

            $(contentID).html('');

            $(contentID).html('<iframe src="' + urlToLoad + '" id="'+ iframeID +'" ></iframe>');

            gadgets.window.adjustHeight();

        }

    };

}(jQuery));

finesse error.png

I also tried

return

    {

        init: function ( urlToLoad, contentID, iframeID )

        {

            $(contentID).html('');

            $(contentID).html('<iframe src="' + urlToLoad + '" id="'+ iframeID +'" ></iframe>');

            gadgets.window.adjustHeight();

        }();

    };

without any positive result.

Any ideas?

1 Accepted Solution

Accepted Solutions

ewindgat
Level 5
Level 5

Very tricky issue!

For me, I move the bracket next to the 'return' like this...

return {

instead of ...

return

{

That worked when I ran a similar structured script.

View solution in original post

2 Replies 2

ewindgat
Level 5
Level 5

Very tricky issue!

For me, I move the bracket next to the 'return' like this...

return {

instead of ...

return

{

That worked when I ran a similar structured script.

Astaroth_666
Level 1
Level 1

Uhh, well, thanks a lot, that was the right answer.

Quite strange ... Head-->Table

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: