Question

I am just starting with Google Sites and after a very frustrating time with the HTML Box not running any Javascript (and it seems that no-one has got it to work) I have started with Google Gadgets.

I am running the following simple code as next step from Hello World and am getting the error "gadgets.MiniMessage is not a constructor" from the Firefox Web Console; even with the ModulePrefs setup as per the Google documentation.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="HTML5 Test" />
  <Require feature="minimessage"/>
  <Content type="html">
     <![CDATA[
        <script>
            alert( "FFS Do Something" );

            var msg = new gadgets.MiniMessage(__MODULE_ID__);
            if ( window.File && window.FileReader && window.FileList && window.Blob )
            {
                msg.createDismissibleMessage( "HTML5 is supported." );
            }
            else
            {
                msg.createDismissibleMessage( "HTML5 is NOT supported by this browser." );
            }
        </script>
     ]]>
  </Content>
</Module>

Would anyone be able to assist with what is possibly something simple that I am missing?

Was it helpful?

Solution

Was simply an XML syntax error:

<ModulePrefs title="HTML5 Test">
  <Require feature="minimessage"/>
</ModulePrefs>

Can stare at something too long and miss the obvious.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top