Nileshsinh Nileshsinh - 5 months ago 12
jQuery Question

jquery ajax in wordpress page not found error

this link from ajax call
ajax call from this page

output page



$('#sw_stop,#cd_stop').live('click', function() {
clicks += 1;
if (clicks>=10) {
clicks=10;
var alt="Kick Count Completed!";
$("#alert").show();
document.getElementById("alert").innerHTML=alt;
$.APP.stopTimer();
var h=$("#sw_h").text();
var m=$("#sw_m").text();
var s=$("#sw_s").text();

alert(s);
//var name=$("#name").val();
//var message=$("#message").val();

$.ajax({
type:"POST",
url:"http://www.mummycenter.com/kick-ajax/",
data:{hour:h,minute:m,second:s},
success:function(data){
$("#info").html(data);
}

});

}
document.getElementById("clicks").innerHTML = clicks;

});





above code for jquery ajax this code page not found error please help me.

Answer

thanks for comment but problem is pre-defined keyword "hour","minute" that's why ajax not called but by renaming this pre-define keyword now work perfectly

 $('#sw_stop,#cd_stop').live('click', function() {
        		clicks += 1;
        if (clicks>=10) {
    			clicks=10;
    			var alt="Kick Count Completed!";
    			$("#alert").show();
    			document.getElementById("alert").innerHTML=alt;
    			$.APP.stopTimer();
    			var h=$("#sw_h").text();
    			var m=$("#sw_m").text();
    			var s=$("#sw_s").text();
    			
    			alert(s);
    			//var name=$("#name").val();
            //var message=$("#message").val();
 				
            $.ajax({
            type:"POST",
            url:"http://www.mummycenter.com/kick-ajax/",
            data:{ho:h,mi:m,se:s},
            success:function(data){
            $("#info").html(data);
           	}
 
            });
 
    		}
        document.getElementById("clicks").innerHTML = clicks;
            
        });

Comments