Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Operating System (http://www.mac-forums.com/forums/os-x-operating-system/)
-   -   Debugging JavaScript in Safari (http://www.mac-forums.com/forums/os-x-operating-system/301740-debugging-javascript-safari.html)

ewgoforth 07-31-2013 04:32 PM

Debugging JavaScript in Safari
 
Hello,

I'm trying to troubleshoot some problems my website has with Safari. I have Safari 6.0.2 running on a Mac that I'm remoted into via iRAPP. I'm not sure what version of the OS this Mac is using.

From the research I've done, I should be able to step through my JavaScript by going to the Menu and choosing Develop->Start Debugging JavaScript. I've added the Develop menu to my Safari, but I don't see that option, just Start Profiling JavaScript and Start Timeline Recording.

I've added a debugger statement to my JavaScript, but Safari acts as if it isn't there. I've debugged in Chrome, Dragonfly (pre-webkit Opera), FireBug, Venkman, and IE Developer Tools (IE6-10); this is my first time in Safari.

-Eric

vansmith 07-31-2013 04:40 PM

Take a look at this document.

ewgoforth 07-31-2013 05:13 PM

Quote:

Originally Posted by vansmith (Post 1529412)
Take a look at this document.

Thanks, that had some useful information, but the only method I saw for stepping into your JavaScript (Putting a breakpoint next to the line of code), didn't really make sense in the context I'm in. I don't have a big block of JavaScript, like a standalone .js file, but instead have a block that's onclick attribute of an anchor tag.

I did figure out how to get it to break though. I found in the little icon bar at the top of the Web Inspector, to the right of "Issue" (Exclamation Point) icon, I found a debug icon. The icon looks kind of like two horizontal parallel lines with a dashed line in the middle. I clicked on that and the next time I clicked on my anchor, it "saw" the debugger statement and stopped there.

-Eric


All times are GMT -4. The time now is 01:05 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.