मुझे Chrome डीबगिंग टूल का पता नहीं लग सकता है।
मेरे पास क्रोम संस्करण 21.0.1180.60 मीटर है।
मैंने जो कदम उठाए:
- मैंने कंसोल लाने के लिए ctrl-shift-i दबाया।
- सूत्रों पर क्लिक किया गया तो उस प्रासंगिक जावास्क्रिप्ट फ़ाइल का चयन करें जिसे मैं डीबग करना चाहता हूं।
- मैं ब्रेकपॉइंट सेट करता हूं जहां मैं चाहता हूं कि कोड बाईं तरफ लाइन के बगल में गटर पर एक नीला टैग लगाकर बंद हो जाए।
- मैंने अपने वेबपेज पर बटन पर क्लिक किया (जो एक php रेंडर पेज है) जो जावास्क्रिप्ट कोड को आरंभ करता है।
- कोड बिना रुके सफलतापूर्वक चला गया।
मैंने यह भी देखा कि घड़ी की अभिव्यक्तियाँ भी काम नहीं करती हैं। यह मुझे बताता रहता है कि मैं जिस चर को देखना चाहता हूं, वह अपरिभाषित है।
आगे के परीक्षण में पाया गया कि यह मेरा कोड है जो ब्रेकपॉइंट को विफल कर रहा है। ऐसा लगता है कि यह "$" ("# frmVerification") पर विफल है। सबमिट करें (फ़ंक्शन () {"लाइन") यह उस फ़ंक्शन () के अंदर ब्रेकप्वाइंट में कदम नहीं रखता है।
नीचे है:
//function to check name and comment field
var test = "this is a test";
var test2 = "this is another test";
function validateLogin(){
//if(userEmail.attr("value") && userPass.attr("value"))
return true;
//else
//return false;
}
//onclick on different buttons, do different things.
function ajaxRequest(){
}
$(document).ready(function(){
//When form submitted
$("#frmVerification").submit(function(){
var username = $("#username");
var token = $("#token");
var action = $("#action");
var requester = $("#requester");
if(validateLogin()){
$.ajax({
type: "post",
url: "verification.php",
data: "username="+username.html()+"&token="+token.val()+"&action="+action.val()+"&requester="+requester.val(),
success: function(data) {
try{
var jsonObj = $.parseJSON(data); //convert data into json object, throws exception if data is not json compatible
if(jsonObj.length > 0){//if there is any error output all data
var htmUl = $('<ul></ul>');
$.each(jsonObj, function(){
htmUl.append('<li>' + this + '</li>');
});
$("#errOut").html(htmUl);
}else{
alert("Your account is now activated, thank you. If you have already logged in, press OK to go to the home page. If not, you must log in first.");
window.location.replace("home.php");
}
}
catch(e){//if error output error to errOut]
$("#errOut").html("PHP module returned non JSON object: <p>"+data+"</p>");
}
}
});
}
else alert("Please fill UserName & Password!");
return false;
});
});

