IE Error TypeError: Unable to get value of the property 'set': object is null or undefined
IE Error TypeError: Unable to get value of the property 'set': object is null or undefined
当我在 IE9 中 运行 我的 Web 应用程序时出现以下错误。该应用程序正在使用 Struts 和 DOJO UI.
开发控制台显示:
TypeError: Unable to get value of the property 'set': object is null or undefined
FF或其他浏览器不会出现此错误。我查看了此问题的其他解决方案,none 似乎解决了我的问题。
我试过在我的网页头部使用标签:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
失败的JavaScript:
require(["dojo/on", "dojo/dom", "dojo/_base/lang", "dojo/domReady!", "dojo/query","dijit/registry"],
function (on, dom, lang, query) {
$(document).ready(function () {
var addButton = dijit.byId('addName');
if(addButton){
addButton.on('click', function (evt) {
evt.preventDefault();
grid.addRecord('name');
});
}
});
进行以下更改,您应该可以开始了。
// Moved dojo/domReady! at the end. Added dojo/ready module.
require(["dojo/on", "dojo/dom", "dojo/_base/lang", "dojo/ready", "dojo/query","dijit/registry", "dojo/domReady!" ],
// The callback list below should match the modules in the require statement.
function (on, dom, lang, ready, query, registry) {
// $(document) refers to Jquery plugin. Are you using Jquery
//$(document).ready(function () {
ready(function () { // using the dojo/ready module.
// changed dijit to registry
//var addButton = dijit.byId('addName');
var addButton = registry.byId('addName');
if(addButton){
addButton.on('click', function (evt) {
evt.preventDefault();
grid.addRecord('name');
});
}
});
当我在 IE9 中 运行 我的 Web 应用程序时出现以下错误。该应用程序正在使用 Struts 和 DOJO UI.
开发控制台显示:
TypeError: Unable to get value of the property 'set': object is null or undefined
FF或其他浏览器不会出现此错误。我查看了此问题的其他解决方案,none 似乎解决了我的问题。
我试过在我的网页头部使用标签:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
失败的JavaScript:
require(["dojo/on", "dojo/dom", "dojo/_base/lang", "dojo/domReady!", "dojo/query","dijit/registry"],
function (on, dom, lang, query) {
$(document).ready(function () {
var addButton = dijit.byId('addName');
if(addButton){
addButton.on('click', function (evt) {
evt.preventDefault();
grid.addRecord('name');
});
}
});
进行以下更改,您应该可以开始了。
// Moved dojo/domReady! at the end. Added dojo/ready module.
require(["dojo/on", "dojo/dom", "dojo/_base/lang", "dojo/ready", "dojo/query","dijit/registry", "dojo/domReady!" ],
// The callback list below should match the modules in the require statement.
function (on, dom, lang, ready, query, registry) {
// $(document) refers to Jquery plugin. Are you using Jquery
//$(document).ready(function () {
ready(function () { // using the dojo/ready module.
// changed dijit to registry
//var addButton = dijit.byId('addName');
var addButton = registry.byId('addName');
if(addButton){
addButton.on('click', function (evt) {
evt.preventDefault();
grid.addRecord('name');
});
}
});