我有下面的代碼,我嘗試手動解析,因爲我在此示例後面創建了一個預加載器(http://acuriousanimal.com/blog/)十二分之二千零一十/ 05 /如何到創建-A-預加載功能於道場/):parser.parse()無法在IE9容器中解析(dojo 1.7.2)
<div id="appLayout" class="demoLayout" data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design: 'headline', style: 'width: 100%; height:100%'">
<div id="contentTabs" class="centerPanel" data-dojo-type="dijit.layout.TabContainer"
data-dojo-props="region: 'center', tabPosition: 'top', style: 'width: 100%; height:100%'">
<div data-dojo-type="dijit.layout.BorderContainer" id="inbox" title="Inbox" data-dojo-props="design: 'headline', style: 'width: 100%, height:100%'">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'left', splitter: true"
style="width: 50%; height:100%;">
<div id="grid">
</div>
</div>
<div id="emailcontainer" class="demoLayout" data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design: 'headline', region: 'center', style: 'width: 100%; height:100%'">
<div id="emailUserAccounts" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top', style: 'width: 50%; height:14px'">
User Reports
</div>
<div id="emailbody" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center', style: 'width: 50%;'">
Select an E-Mail from the Inbox
</div>
</div>
</div>
</div>
<div id="toolbar" class="edgePanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'"
style="text-align: right;">
<input id="searchtext" type='text' size='50' style="height: 30px;" />
<button id="searchbtn" type="button" style="width: 120px">
Search</button>
<button id="invertbtn" type="submit" style="width: 120px">
Invert Status</button>
<div id="supportstaffselect">
</div>
<button id="assignbtn" type="button" style="width: 120px">
Assign</button>
<select id="priorityselect" data-dojo-type="dijit.form.Select" name="priorityselect">
<option value="0">Low</option>
<option value="1" selected="selected">Normal</option>
<option value="2">Medium</option>
<option value="3">High</option>
<option value="4">+1</option>
</select>
<button id="prioritybtn" type="button" style="width: 120px">
Change Priority</button>
<button id="newMessage" type="button" style="width: 120px">
New Message</button>
<button id="replybtn" type="button" style="width: 120px">
Reply</button>
<button id="replyallbtn" type="button" style="width: 120px">
Reply All</button>
<button id="forwardbtn" type="button" style="width: 120px">
Forward</button>
</div>
<div id="filtersnavigation" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'left'" style="width: 130px;">
<ul class="filterlist">
<li class="filterlistitem" id="everythingfilter">Everything</li>
<li class="filterlistitem" id="openfilterid">Open</li>
<li class="filterlistitem" id="closedfilterid">Closed</li>
<li class="filterlistitem" id="unrepliedfilterid">Unreplied</li>
<li class="filterlistitem" id="repliedfilterid">Replied</li>
<li class="filterlistitem" id="minefilterid">Mine</li>
<li class="filterlistitem" id="mineunrepliedfilterid">Mine
Unreplied</li>
</ul>
</div>
</div>
此代碼分析和正確加載在Firefox和Chrome沒有問題或錯誤,但parser.js拋出arbirtrary嘗試通過在腳本中調用解析BorderContainer或TabContainer解析IE9中的錯誤parser.parse()eg
控制檯日誌: 「無法加載類dijit.layout.BorderContainer」
錯誤的IE9點是在parser.js(道場釋放-1.7.2-SRC)的線132:
darray.forEach(nodes, function(obj){
if(!obj){ return; }
var node = obj.node || obj,
type = dojoType in mixin ? mixin[dojoType] : obj.node ? obj.type : (node.getAttribute(dataDojoType) || node.getAttribute(dojoType)),
ctor = _ctorMap[type] || (_ctorMap[type] = dlang.getObject(type)),
proto = ctor && ctor.prototype;
if(!ctor){
Line 132 ---> throw new Error("Could not load class '" + type);
}
有沒有人對我做錯了什麼有所瞭解,如果考慮到上述代碼在IE9中完美工作時,我有parseOnLoad:true?
由於
你的data-dojo-config屬性是什麼樣的?需求聲明和回調是什麼樣的? – BuffaloBuffalo
不知道更多的HTML內容 - 我敢打賭,這個問題是DOCTYPE相關的,並回落到各種怪癖模式(解釋不同的行爲和瀏覽器)。但問題是'原子'類加載 - 需要按正確的順序排序。解析器在所有需要的模塊被拉入之前無法運行。 – mschr