0 Replies Latest reply on Apr 5, 2013 1:23 PM by ahcho

    Embedding Javascript into a FM12 database

    ahcho

      Title

      Embedding Javascript into a FM12 database

      Post

           Hello!

           I am trying to render a Javascript chart within a web viewer on a FM12 layout. This webviewer contains the following and only has the "Automatically encode URL" checked:

           --------------------------------

            

           "data:text/html," & ¶ &
           "<!DOCTYPE html >" & ¶ &
           "<html>" & ¶ &
           "<head>" & ¶ &
           "    <link rel="&Quote("stylesheet")&" href="&Resources::DemoCSS&" type="&Quote("text/css")&" media="&Quote("screen")&" />" & ¶ &
               
           "    <script src="&Resources::RGraphCommonCore&" ></script>" & ¶ &
           "    <script src="&Resources::RGraphVProgress&" ></script>" & ¶ &
               
           "    <title>A basic VProgress chart</title>" & ¶ &
           "</head>" & ¶ &
           "<body>" & ¶ &
            
           "    <h1>A basic VProgress chart</h1>" & ¶ &
            
           "    <canvas id="&Quote("cvs")&" width="&Quote("100")&" height="&Quote("400")&">[No canvas support]</canvas>" & ¶ &
               
           "    <script>" & ¶ &
           "        window.onload = function ()" & ¶ &
           "        {" & ¶ &
           "            var vprogress = new RGraph.VProgress('cvs', 89,100);" & ¶ &
           "            vprogress.Draw();" & ¶ &
            
           "        }" & ¶ &
           "    </script>" & ¶ &
            
           "    <p>" & ¶ &        
           "        <a href="&Quote(".")&"/"&Quote(">&laquo; Back</a>")&"" & ¶ &
           "    </p>" & ¶ &
            
           "</body>" & ¶ &
           "</html>"
            
           --------------------------------
           Now this HTML references 3 external files (RGraphVProgress.js, RGraphCommonCore.js, demon.css) which I have added  into text fields in a table called Resources (the files are from http://www.rgraph.net). They are all global fields.
            
           The output within the webviewer only shows the header "A basic VProgress Chart!". It seems to fall apart when it calls the script. There aren't any errors when I save the webviewer.
            
           What am I missing?
            
           Aaron