• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 51
  • Last Modified:

Debug JQuery/JavaScript?

Is it possible to be on a live page and "debug" the script below?

<script>
    function SaveValidation() {
        var surveydata = "";
        $('.rblsurvey').each(function () {
            debugger;
            var checked_radio = $("[id*=" + $(this).context.id + "] input:checked");
            var value = checked_radio.val();
                    
            var question = $(this).context.className.replace("rblsurvey rblMultiList_", "");
            surveydata = surveydata + question + "," + value + "|";
            //alert(surveydata);         
            $("#hdnsurveyvalues").val(surveydata);
        });

        $(".chks").each(function (index) {
            debugger
            var questionid = $(this).attr("class").replace("chks chkquestions_", "");
            var answerid = "";

            $(this).find(":checked").each(function (index) {
                answerid = questionid + "," + $(this).val() + "|" + answerid;
            });
                alert(answerid)                                        
            $("#hdnsurveyvaluesChk").val(answerid);
        });

              
    }
</script>

Open in new window

0
Larry Brister
Asked:
Larry Brister
1 Solution
 
Jim RiddlesPrepress/OMS SpecialistCommented:
I'm not sure exactly what you mean by your question.  If you are asking if you can debug JavaScript in a website, then the answer is "Yes".  Simply use the developer tools console in your browser.

Incidentally, you are missing the ";" at the end of "debugger".  Note that you should not use this on a production site, as it can cause issues, but if it is for a very limited scope, then it may be acceptable.
0
 
Larry Bristersr. DeveloperAuthor 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

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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