DHTMLX 可视化编辑器。如何使用生成的代码
我对网络编程有点陌生。使用 DHTML 3.0 Visual Designer 我创建了一个小网页,其中包含以下内容自动生成的代码:
dhtmlx.image_path='./codebase/imgs/';
var main_layout = new dhtmlXLayoutObject(document.body, '1C');
var a = main_layout.cells('a');
a.setHeight('0');
a.setWidth('0');
a.hideHeader();
a.fixSize(0,1);
var toolbar_2 = a.attachToolbar();
toolbar_2.setIconsPath('./codebase/imgs/');
toolbar_2.loadXMLString('<toolbar><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/save.gif" imgdis="" title="Actualizar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/text_document.gif" imgdis="" title="Editar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/print.gif" imgdis="" title="Imprimir" /></toolbar>', function(){});
var toolbar_1 = main_layout.attachToolbar();
toolbar_1.setIconsPath('./codebase/imgs/');
toolbar_1.loadXMLString('<toolbar><item type="button" text="N1" img="" /><item type="separator" /><item type="button" text="N2" /><item type="separator" /><item type="button" text="N3" img="" /><item type="separator" /><item type="button" text="N4" /><item type="separator" /><item type="button" text="N5" /></toolbar>', function(){});
我不明白如何将此代码放入 HTML 页面。我尝试用 标签包围此代码,创建
function doOnLoad()
,然后添加 。但这不起作用。
I'm a bit new to web-programming. Using DHTML 3.0 Visual Designer I created a small web-page with the following automatically generated code:
dhtmlx.image_path='./codebase/imgs/';
var main_layout = new dhtmlXLayoutObject(document.body, '1C');
var a = main_layout.cells('a');
a.setHeight('0');
a.setWidth('0');
a.hideHeader();
a.fixSize(0,1);
var toolbar_2 = a.attachToolbar();
toolbar_2.setIconsPath('./codebase/imgs/');
toolbar_2.loadXMLString('<toolbar><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/save.gif" imgdis="" title="Actualizar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/text_document.gif" imgdis="" title="Editar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/print.gif" imgdis="" title="Imprimir" /></toolbar>', function(){});
var toolbar_1 = main_layout.attachToolbar();
toolbar_1.setIconsPath('./codebase/imgs/');
toolbar_1.loadXMLString('<toolbar><item type="button" text="N1" img="" /><item type="separator" /><item type="button" text="N2" /><item type="separator" /><item type="button" text="N3" img="" /><item type="separator" /><item type="button" text="N4" /><item type="separator" /><item type="button" text="N5" /></toolbar>', function(){});
I don't understand how to put this code into HTML page. I tried to surround this code with <script>
tags, create function doOnLoad()
, and then add <body onload="doOnLoad()" style="width:100%; height:100%; margin:0px; overflow:hidden;">
. But it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查文档
您需要
Check the docs
You need to