by Foam Head » Tue Sep 01, 2009 10:17 pm
I've been developing a Dojo 1.3.* web application in FireFox 3.0.* -> 3.5.2 (on Windows) and I've never had any issues like this with NoScript. It's possible that you and I have something configured differently, but once I've configured NoScript to include the necessary hosts (for the example you gave at stackoverflow.com, you'd need ajax.googleapis.com and 3wcloud-com-provisioning-qa.appspot.com to be trusted), it has never interfered with Dojo.
Looking at your example, I think the problem is your use of Dojo. It is very poorly documented, but the Dojo XD loader is an
*asynchronous* loader. When using the XD loader, dojo.require returns immediately, but the module is loaded in the background. You aren't using any dojo.require's, but the concept applies to page loading as well. The only way to know when all dojo.require'd modules have been loaded is by using dojo.addOnLoad. My replies aren't visible (stupid Drupal software Dojo uses...), but you should be able to get the point from
this Dojo thread.
Back to your example, you aren't using any addOnLoad's. This means you are completely relying on race conditions to define dojo.* before your inline JavaScript runs. I'm guessing that with NoScript doing some extra validations, the timing is different and you see an error. However, the root cause is the race condition. Use some addOnLoad's and you should see your problem fixed even with NoScript enabled
.
-Foam
I've been developing a Dojo 1.3.* web application in FireFox 3.0.* -> 3.5.2 (on Windows) and I've never had any issues like this with NoScript. It's possible that you and I have something configured differently, but once I've configured NoScript to include the necessary hosts (for the example you gave at stackoverflow.com, you'd need ajax.googleapis.com and 3wcloud-com-provisioning-qa.appspot.com to be trusted), it has never interfered with Dojo.
Looking at your example, I think the problem is your use of Dojo. It is very poorly documented, but the Dojo XD loader is an [b]*asynchronous*[/b] loader. When using the XD loader, dojo.require returns immediately, but the module is loaded in the background. You aren't using any dojo.require's, but the concept applies to page loading as well. The only way to know when all dojo.require'd modules have been loaded is by using dojo.addOnLoad. My replies aren't visible (stupid Drupal software Dojo uses...), but you should be able to get the point from [url=http://www.dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/xd-cdn-local-custom-resource-loading-method-matters]this Dojo thread[/url].
Back to your example, you aren't using any addOnLoad's. This means you are completely relying on race conditions to define dojo.* before your inline JavaScript runs. I'm guessing that with NoScript doing some extra validations, the timing is different and you see an error. However, the root cause is the race condition. Use some addOnLoad's and you should see your problem fixed even with NoScript enabled :D.
-Foam