0

I am using this code if jQuery. and its not working where it has to be I want to debug every line of code by using "console.log" I am new for this I have installed firebug for debugging Can any please tell me how would I use console.log on this code

<script type="text/javascript">
       $(document).ready(function() {
         $("select").flexselect({ hideDropdownOnEmptyInput: true });
         $("select").flexselect();
         $("input:text:enabled:first").focus();
         $("form").submit(function() {
           alert($(this).serialize());
           return false;
           ;
         });
       });
     </script>
7
  • What about debugger;??? Commented Mar 3, 2014 at 11:39
  • if you are using chrome/firefox, goto inpect element on tab scripts select your desired script and add breakpoint on the code. Commented Mar 3, 2014 at 11:42
  • will you give few more words of explanation about using console..? Commented Mar 3, 2014 at 11:42
  • @MurtazaHussain can u explain me more about adding breakpoint? Commented Mar 3, 2014 at 11:48
  • @Jatt.net Nope. You can debug the jQuery code via breakpoint unless it is not minified. Commented Mar 3, 2014 at 11:48

1 Answer 1

1

When you press F12, you can see the developer tools either in firebug or native browser tools.

Here you can place a breakpoint like in the image below

enter image description here

If it is an external js file, look for the file in source tab.

embedded js scripts can be found in element tab.

Now you can easily debug your scripts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.