1
我遇到了Dojo 1.8的IE8問題。現在我的實現(我無法發佈由於工作隱私問題)呈現樹,但我無法選擇,並得到一個函數預期的錯誤行15178字符11 dojo.js未壓縮。每當我將鼠標懸停在樹中的一個節點上時,都會觸發。Dojo 1.8樹在IE8/9中無法正常工作,鼠標在節點上時觸發錯誤
線路如下:
while(!matchesTarget.matches(eventTarget, selector, target)){
if(eventTarget == target || children === false || !(eventTarget = eventTarget.parentNode) || eventTarget.nodeType != 1){ // intentional assignment
return;
}
這不會在Chrome或FF發生。
嘗試和調試我試着從dojo運行示例代碼,既有標準的參考代碼,也有來自livedocs的代碼。既不在代碼玻璃也不在jsfiddle中工作,但都在chrome和FF中工作。
我正在使用一個編程實現。
有沒有其他人遇到過這個問題,或者這可能是一個已知問題?
下面是示例代碼我試圖在IE中運行:
require([
"dojo/_base/window", "dojo/store/Memory",
"dijit/tree/ObjectStoreModel", "dijit/Tree",
"dojo/domReady!"
], function(win, Memory, ObjectStoreModel, Tree){
// Create test store, adding the getChildren() method required by ObjectStoreModel
var myStore = new Memory({
data: [
{ id: 'world', name:'The earth', type:'planet', population: '6 billion'},
{ id: 'AF', name:'Africa', type:'continent', population:'900 million', area: '30,221,532 sq km',
timezone: '-1 UTC to +4 UTC', parent: 'world'},
{ id: 'EG', name:'Egypt', type:'country', parent: 'AF' },
{ id: 'KE', name:'Kenya', type:'country', parent: 'AF' },
{ id: 'Nairobi', name:'Nairobi', type:'city', parent: 'KE' },
{ id: 'Mombasa', name:'Mombasa', type:'city', parent: 'KE' },
{ id: 'SD', name:'Sudan', type:'country', parent: 'AF' },
{ id: 'Khartoum', name:'Khartoum', type:'city', parent: 'SD' },
{ id: 'AS', name:'Asia', type:'continent', parent: 'world' },
{ id: 'CN', name:'China', type:'country', parent: 'AS' },
{ id: 'IN', name:'India', type:'country', parent: 'AS' },
{ id: 'RU', name:'Russia', type:'country', parent: 'AS' },
{ id: 'MN', name:'Mongolia', type:'country', parent: 'AS' },
{ id: 'OC', name:'Oceania', type:'continent', population:'21 million', parent: 'world'},
{ id: 'EU', name:'Europe', type:'continent', parent: 'world' },
{ id: 'DE', name:'Germany', type:'country', parent: 'EU' },
{ id: 'FR', name:'France', type:'country', parent: 'EU' },
{ id: 'ES', name:'Spain', type:'country', parent: 'EU' },
{ id: 'IT', name:'Italy', type:'country', parent: 'EU' },
{ id: 'NA', name:'North America', type:'continent', parent: 'world' },
{ id: 'SA', name:'South America', type:'continent', parent: 'world' }
],
getChildren: function(object){
return this.query({parent: object.id});
}
});
// Create the model
var myModel = new ObjectStoreModel({
store: myStore,
query: {id: 'world'}
});
// Create the Tree.
var tree = new Tree({
model: myModel
});
tree.placeAt(win.body());
tree.startup();
});
該樹與ie8和ie9很好地工作......你能提供一個模仿你的錯誤的小提琴嗎? –
不幸的是,它在小提琴中奏效,但在我們的產品中實現時卻不奏效。您是否能夠提供任何有關可能導致該問題的信息,或者我可以在哪裏嘗試並進行調試? –
1.嘗試將div ID傳遞給placeAt方法。 2.嘗試在現成的功能中執行你的代碼! –