Use Javascript library loaded in parent HTML page in embedded iframe

My application is using the ExtJS library to generate charts in Javascript. Unfortunately, as far as I've been able to tell from the examples and documentation online, ExtJS doesn't let you generate new charts without a page reload. My pages will have a lot of charts on them, and I'd like to allow my user to change the chart type for a dataset without having to go through a page reload. My solution so far has been to make each chart inside of an embedded iframe, which allows me to reload a new type of chart in a new iframe without reloading the page. The problem is that so far, I've had to load the ExtJS library in each iframe separately, which gets pretty slow when you're talking about 15 or 20 iframes. What I'd like is to be able to use the ExtJS library inside of my iframes without having to load the library for each one. When I used "parent" to access the ExtJS functions, it started acting up, mostly because of how ExtJS requires you to put your chart generation in their Ext.onReady() function (calling parent.Ext.onReady() gave some very strange behaviors). Any ideas for solutions or workarounds? I would use another library, but I'm already migrating from an uglier, flash based chart library, and I really like what ExtJS is capable of. Thanks.
It seems very unlikely that ExtJS forces a page reload to generate a new chart.

以上就是Use Javascript library loaded in parent HTML page in embedded iframe的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准