Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

how do I debug jQuery?

I know  how to stop at a breakpoint in JavaScript. but when i set a breakpoint in jQuery the whole function is a single breakpoint.

Is there a way around this?

Thanks!
0
newbieweb
Asked:
newbieweb
  • 5
  • 5
  • 2
2 Solutions
 
crysallusCommented:
If you wish to debug the internals of a jquery function, simply download the full source version (look for the Uncompressed links), then you can set break points in the jquery code just like any other javascript file.
0
 
leakim971PluritechnicianCommented:
Check this : http://code.jquery.com/jquery-1.6.4.min.js
and this : http://code.jquery.com/jquery-1.6.4.js

this is the same version but you should use the last one to deug (set break point)
the first one is a mimified version, a lighter version

http://jscompress.com/
0
 
newbiewebSr. Software EngineerAuthor Commented:
What if it's only my jQuery I want to debug?
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
leakim971PluritechnicianCommented:
just place "debugger;" keyword in your own jQuery
0
 
newbiewebSr. Software EngineerAuthor Commented:
> just place "debugger;" keyword in your own jQuery

Where do I place "debugger"?
0
 
leakim971PluritechnicianCommented:
anywhere you want to stop the code to debug (see current value)
0
 
newbiewebSr. Software EngineerAuthor Commented:
I have no idea what you mean. I thought I could place a breakpoint, but it lighlighted the whole jquery function.

Confused...
0
 
leakim971PluritechnicianCommented:
you debug jQuery by opening the jQuery file not by debugging the code using the jQuery functions

if you need to debug :
$(".xxx").html()

you have nothing to do with YOUR script, you need to use a not minimified jQuery.js, search for the jquery.html function and place your breakpoints (or debugger keyword) in this file (jQuery-1.x.x.js)
0
 
crysallusCommented:
What debugger are you using? Firebug (what I normally use)?

Perhaps some screenshots might clarify what your issue is, and what you are trying to do. Or some of your code perhaps.
0
 
newbiewebSr. Software EngineerAuthor Commented:
That's how I open the file, from the top of Visual Studio 2010, which shows all the scripts rendered to the browser.

Inside that file, I tried to set the breakpoint inside a jquery function, but the whole function became red...
0
 
leakim971PluritechnicianCommented:
please post a screen copy
0
 
newbiewebSr. Software EngineerAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now