MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to General Development
View previous topic Printable version Log in to check your private messages View next topic
Author Message
nvintila
Post subject: [TIP] Debugging code downloaded by Dojo  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
nvintila
Post subject:   PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: May 13, 2006 - 10:53 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23818

Nick,
Thank you for following up for the benefit of others, great tip. I'm going to make it sticky.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
pompiuses
Post subject:   PostPosted: Feb 19, 2009 - 02:46 PM



Joined: Feb 19, 2009
Posts: 1

I know this is an old thread, but I'm having trouble debugging using dojo 1.1.1.

There's no dojo/src/browser_debug.js or dojo.hostenv.writeIncludes() anymore.

Have someone found a good solution to setting breakpoints in your own dojo widgets using the MyEclipse javascript debugger?

Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits