if you saved the contents of http://www.wiris.net/demo/editor/editor<http://www.google.com/url?q=http%3A%2F%2Fwww.wiris.net%2Fdemo%2Feditor%2Feditor&sa=D&sntz=1&usg=AFQjCNH1c6la7z-7dN4XbZso2ghrp0nabg>
as static/editor.js , then replace the line <script src="http://www.wiris.net/demo/editor/editor<http://www.google.com/url?q=http%3A%2F%2Fwww.wiris.net%2Fdemo%2Feditor%2Feditor&sa=D&sntz=1&usg=AFQjCNH1c6la7z-7dN4XbZso2ghrp0nabg> "></script> with <script src="{{=URL('static', 'editor.js')}}"></script> or, alternatively, with the default layout you can just use response.files.append(URL('static', 'editor.js')) On Monday, May 19, 2014 4:57:11 PM UTC+2, niki wrote: > > hi, I have been trying to understand how i can include static JavaScript > files on my view layout.html > I want to embed an editor on web2py. > I have an html code which works out fine on its own: However i would like > this code to work in web2py as well. I have tried using > 'response.files.append(URL('static','editor.js'))' but it will not work > > Please can you direct me on how to handle this. Thanks. Here is the html > code that works. > > '<html> > <head> > <script > src="http://www.wiris.net/demo/editor/editor<http://www.google.com/url?q=http%3A%2F%2Fwww.wiris.net%2Fdemo%2Feditor%2Feditor&sa=D&sntz=1&usg=AFQjCNH1c6la7z-7dN4XbZso2ghrp0nabg> > "></script> > <script> > var editor; > window.onload = function () { > editor = com.wiris.jsEditor.JsEditor.newInstance({'language': 'en'}); > editor.insertInto(document.getElementById('editorContainer')); > } > </script> > </head> > <body> > <div id="editorContainer"></div> > </body> > </html>' > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

