Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
tpblack
Posts: 24
Registered: ‎06-03-2013
My Device: z10
My Carrier: idea

How to Debug JavaScript code??

I want to debug JavaScript code for my app, how do I achieve this????

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: How to Debug JavaScript code??

Build with the -d switch then install on a device

 

Now open Chrome to the IP of the device

 

Click the "Circle thing with arrow" then hit F5

 

You have to do it in this order - the first refreshed the browser, the second the client

 

In that view find the bit you think maight be going wrong and click in the margin (breakpoint)

 

After that it gets easy - you just need to know how to get this far




Click the like button if you find my posts useful!
Please use plain text.
New Developer
tpblack
Posts: 24
Registered: ‎06-03-2013
My Device: z10
My Carrier: idea

Re: How to Debug JavaScript code??

ok then let me try this, its little complicated but letme try.....

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: How to Debug JavaScript code??

The explanation is harder than actually doing it

 

It's quite easy and your app will start up with a pop-up giving you the address to out into Chrome

 

Note that it HAS to be Chrome

 

Make sure you compile with -d

 

The option you want from the page you get in Chrome is the middle one

 

As long as you've given your app a decent identifier its obvious which bit to click on as the app name will mbe mentioned in the list of options

 

Once you're in click on the Source icon @ the top then select whatever file you want from the dropdown on the top left

 

Find the bit of code that's dodgy - click in the margin - it goes blue

 

[F5]

 

Trigger the code - e.g. press something that calls it and Chrome will stop at the line you've set the brakpoint on - your device will tell you it's paused in debug

 

This also works in Simulator but I ain't used that way to test for over a year so can't be specific on that area




Click the like button if you find my posts useful!
Please use plain text.