 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: [TIP] Debugging code downloaded by Dojo
Posted: May 12, 2006 - 08:14 PM
|
|

Joined: May 10, 2006
Posts: 2
|
|
Thanks for the JS debugger.
I am evaluating it and i can only get it to stop in JS code embedded in the HTML file i started with or the scripts listed in the head. We use Dojo and most of the JS code gets downloaded on demand: scripts are downloaded by Dojo and eval()-ed.
Is this debugger supposed to debug this JS code too?
I am currently trying to change Dojo to emit includes <script></script> for the scripts Dojo imports/requires/downloads.
I am having some success but i am breaking the internal state of the widget manager in Dojo.
Do you guys already have a solution to this?
Thanks
Nick |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: May 13, 2006 - 07:03 PM
|
|

Joined: May 10, 2006
Posts: 2
|
|
I figured out how to use something from Dojo to achieve this.
1) Include browser_debug.js after dojo.js
| Code: |
<script type="text/javascript" src="../../dojo/dojo.js"></script>
<script type="text/javascript" src="../../turbo/turbo.js"></script>
<script type="text/javascript" src="../../dojo/src/browser_debug.js"></script>
|
2) Call writeIncludes after the last dojo.require from the HTML file you debug.
| Code: |
dojo.hostenv.writeIncludes();
|
This sequence effectively overrides the default code loading mechanism in Dojo (see loadUri from browser_debug.js) and emits <script/> snippets in the head of the document thus convincing the browser to download the scripts itself. Using a smart technique this new loadUri includes the scripts in the correct order based on their dependencies.
Good luck
Nick |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: May 13, 2006 - 10:53 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23347
|
|
Nick,
Thank you for following up for the benefit of others, great tip. I'm going to make it sticky. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |