English 中文(简体)
RequireJS traditional script loading aka Order Plugin
原标题:

I have been beating my head against this for quite a while. I m loading about 60 script files that need to respect a certain dependency structure. Loading these normally in requirejs does not work, so I started using the order plugin.

The order plugin works great in Firefox 3.6.12, IE7, IE8, but my application explodes in Chrome 8. Chrome seems to execute in any order it feels like. Is this a known issue or are there some workarounds?

最佳回答

Disclaimer, I am the main developer for RequireJS:

There has been a change in the nightly WebKits that breaks the order plugin. It also affects LABjs. It resulted in implementations of the HTML5 spec that changed dynamic script loading behavior. The good thing is that browsers are starting to converge, the bad thing is that the spec has not accounted for ordered execution of dynamically added script elements.

The author of LABjs, Kyle Simpson, has been engaging the HTML5 group to get an official spec change that supports order execution of dynamically added scripts. So far that Firefox nightlies have implemented a change, and I believe WebKit may be considering it too. Another good writeup is by Henri Sivonen.

All that said, I thought it affected WebKit nightlies, and I am not sure if Chrome 8 has picked up the change. I expect that is the likely reason for the breakage, but my unit test for the order plugin seems to work for me in Chrome 8.

If you can confirm you are on Chrome 8 and perhaps not the developer channel that might have maybe a Chrome 9, that would be good to know. It would also be good to know what version of RequireJS you are using. 0.15 has a fix that corresponds to the change in the Firefox nightlies. If you are using an older version of RequireJS you may try the newer one.

问题回答

暂无回答




相关问题
Redirect to cache URL in Chrome browser

self.location = cache: + self.location I want to redirect from "[URL]" to "cache:[URL]". I just want this code to work in Chrome browser.

我如何更新/重载 Chrome延?

I m在4号 Chrome(目前为4.0.249.0)中开发一个延伸点,显示用户在地位酒吧中的形象。 Ive设计了一个供用户使用的备选办法网页......

Setting Opacity in CSS For Chrome

I ve tried the following: (this is actually for fancybox, as the overlay does not show in chrome/safari: $("#fancy_overlay").css({<br /> background-color : opts....

Chrome Blocking Javascript, Google Wave, Google Gadgets

Project: Developing a gadget template for Google Wave which will allow my Flash movies to interact with the Wave api. I had to adapt the existing Flex application so that it would work with ...

image height using jquery in chrome problem

$( img ).height() returns 0 in chrome, but it returns the actual height in IE and firefox. Whats the actual method to get the height of the image in chrome?

jQuery block moving

I wanna move a div block to the top, so I coded like this: CSS part: .movingPart{ margin-top:80px; } jQuery part: $(document).ready(function() { $( #btn ).click(function() { $( .movingPart )....

Table cells bad rendering with Google Chrome/Webkit

On the following code, COL1A and COL3A are not 50% height with Chrome or Webkit. It works fine with IE7 and Firefox. <table border="1"> <tr> <td height="100%">COL 1A</td>...

热门标签