2013-10-01 34 views
1

我想要使用d3.v3.js,world-110m.json和topojson.v1.js來獲取在IE9中工作的地圖(我也在使用jQuery 10.1因此也被加載)。它在FF和Chrome中運行良好,但是,據我所知,IE 8及以下版本沒有本地SVG支持,因此如果沒有解決方法,則無法支持。D3:在IE9中使用d3.js時出現「無效參數」錯誤

不幸的是,IE9似乎也沒有工作。在IE 9控制檯中出現錯誤:

SCRIPT87:無效的參數。 d3.v3.js,行726字符4

d3_selectionPrototype.insert = function(name, before) { 
     name = d3_selection_creator(name); 
     before = d3_selection_selector(before); 
     return this.select(function() { 
      return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments)); 
     }); 
    }; 

726線是「迴歸this.insertBefore」等任何想法是怎麼回事,如何解決?

+0

FWIW:我發現這個錯誤是在d3版本中引入的。 3.2.3(現在是3.3.6)。我就此與Mike Bostock聯繫。他對d3.v3做了輕微的修改,消除了這個錯誤。第777行:return this.insertBefore(name.apply(this,arguments),aheadapply(this,arguments)|| null); – dylanmac

回答

2

IE9沒有像其他瀏覽器那樣實現insertBefore。在this question的答案更詳細我懷疑你的情況下第二個參數爲空。

+0

感謝您的指導。不幸的是,這是在應該處理d3.v3的IE9中拋出的 – dylanmac