Dojo小部件未加载到FireFox中

Dojo小部件未加载到FireFox中

问题描述:

我们在应用程序中加载了dojo小部件时遇到了一个问题。 dojo库被上传到网络发布商,其文件夹结构如下:www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/dojo

We are having an issue loading dojo widgets in our application. The dojo library is uploaded to web publisher and its folder structure is like- www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/dojo

我们正在将所有页面中常见的jsp加载到dojo组件中。我们正在以下列方式加载dojo组件 -

We are loading the dojo componets in a jsp that is common across all the pages. We are loading the dojo components in the following way-

djConfig = {
            isDebug: false,
            debugAtAllCosts: false,
            parseOnLoad: true,
            baseUrl: "http://www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/dojo/",
            modulePaths: {
                xwt: "www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/xwt/"
            }   

这里我们在脚本标签中定义这个 -

here we define this in a script tag-

src="http://www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/dojo/dojo.js"

一旦我们注册了dojo模块路径和dojo.js,我们将以以下方式加载所有必需的dojo小部件 -

Once we have registered the dojo module path and dojo.js, we are loading all the required dojo widgets in the following way-

<script type="text/javascript">
    dojo.require("dojo.parser");

    dojo.require("dijit.dijit");

    dojo.require("xwt.widget.toolbar.Toolbar");

    dojo.require("xwt.widget.form.FilteringSelect");

    //and functionality will be defined here
</script>

问题是,当上述代码在Internet Explorer中使用时,它的工作正常。但是如果我们在Firefox中使用相同的代码,则无法加载dojo小部件。我们在firebug控制台中收到以下错误 -

Issue is, when the above code is used in Internet explorer, its working fine. But if we use the same code in Firefox its failing to load the dojo widgets. We are getting the following error in the firebug console-


无法加载dojo.parser,最后尝试为./parser.js。 / p>

could not load dojo.parser, last tried as ./parser.js.

明智的做法是无法加载任何小部件。
请帮忙解决这个问题。对于不同博客中的许多人来说,同样的问题,但没有一个解决方案。
我发现firefox会放一个限制,我试图通过设置参数为false来传递这个限制。即使没有工作。虽然它可行,但这不是一个可行的解决方案,因为我们不能要求最终用户将其设置在浏览器中。请帮我解决这个问题。感谢提前。

Like wise it is unable to load any of the widgets. Please help in resolving this issue. Looked the same issue for many people in different blogs, but none has got a resolution. I found that the firefox will put a restriction, I tried by passing this restriction by setting the parameter to false. Even that did not work. Though it works, it is not a feasible solution as we cannot ask end users to set this in their browsers. Please help me in resolving this issue. Thanks in advance.

请问,

kumarji Alluri

kumarji Alluri

一些事情首先..

djconfig-deprecated

您是否使用跨域?没有必要将路径引用为绝对路径。此外,baseUrl默认为dojo.js的位置,因此请执行此操作。

Are you using crossdomain? There's no need to reference the paths as absolute. Also, baseUrl defaults to the location of dojo.js so strike that out.

事实上,'xwt'命名空间定位为dojox,dojo和dijit的兄弟姐妹,所以你实际上不应该定义它..

Infact, the 'xwt' namespace is positioned as siblings to dojox, dojo and dijit so you shouldnt actually need to define it..

我建议从那个页面使用锅炉。 data-前缀是新的mojo mon,以下应该足够了:

I suggest using boiler from that very page. "data-" prefix is the new mojo mon, following should suffice:

<script src="http://www.wp-mydemopath.com/web/fw/tools/ssue/ui/1.6/auessome/dojo/dojo.js" 
  data-dojo-config="isDebug: false,debugAtAllCosts: false,parseOnLoad: true"><!-- //required for FF3 and Opera (TidyHTML in JSP) --></script>

这个评论的原因<! - //需要FF3和Opera(JSP中的TidyHTML) - > 是,JSP服务器最经常地整理输出,检测到错误的DOM层次结尾和结束标签;问题是脚本标签不应该是自动关闭

The reason for this comment <!-- //required for FF3 and Opera (TidyHTML in JSP) --> is, that JSP servers most often tidies up the output, detecting faulty DOM hierachy and closing tags; Problem being that the script tag should not be self-closing