代码在 Firefox 或 IE 中无法正常工作
应该发生的情况如下:
当用户选择一个选项时,输入字段的特定组合应该与两个表格一起显示。
当用户填写输入字段并单击按钮时,结果应显示在表格中。
那些表没有出现。输入字段甚至不会显示在 js fiddle 中。
它仅适用于最新版本的 Firefox、Chrome、Safari 和 IE。
Firefox 6.0 或 IE 9.08 中不支持。
我犯了一个错误,在家里只用 Chrome 进行编码,当我试图继续在学校工作时,发现我的代码不起作用。
我使用 jsfiddle.net 来验证我的代码并成功完成。虽然还是不行。它甚至无法在 jsFiddle 中正确显示。
这是演示代码的小提琴:
Here is what is supposed to happen:
The moment the user chooses an option a certain combination of input fields should show up along with two tables.
When the user fills in the input fields and clicks the button, the results should appear in the tables.
Those tables aren't showing up. The input fields don't even show up in js fiddle.
It only works in the newest versions of Firefox, Chrome, Safari and IE.
Not in firefox 6.0 or IE 9.08.
I made the mistake of coding exclusively in Chrome at home to discover that my code doesn't work when I tried to continue working at school.
I used jsfiddle.net to validate my code and did so successfully. Although it still won't work. It doesn't even show up properly inside jsFiddle.
Here is the fiddle to demo the code:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
outputTable 方法包含 Caption.align = "middle" 行,该行无法在 IE 中执行,显然在 FF 中也不能执行。将其替换为 Caption.style.textAlign = "middle";它会解决问题。
与 MCaption 相同。
但你在这里能做的最好的事情就是像 css 中那样定义所有样式。
The outputTable method contains line Caption.align = "middle", which cannot be executed in IE and apparently in FF as well. replace it with Caption.style.textAlign = "middle"; and it will fix the problem.
The same with MCaption.
But the best you can do here is to define all styles like that in css.
在您的 js 小提琴中,您收到此错误:
inputOutputCreator 未定义
。这是因为您正在 mootoolsonLoad
函数中加载 js。在左侧的 jsfiddle 设置中将其从onLoad
更改为no wrap
。经过这样的改变,它对我来说效果很好。In your js fiddle you were getting this error:
inputOutputCreator is not defined
. It is because you are loading your js in the mootoolsonLoad
function. Change it fromonLoad
tono wrap
in the jsfiddle settings to the left. With that changed it worked just fine for me.