jquery - Ajax call to PHP script returning status 0 after double refresh -



jquery - Ajax call to PHP script returning status 0 after double refresh -

i had simple form used jquery ajax phone call php script , perform work. code worked 2+ years , sudden stopped working - , has weird behavior i've having problem debugging.

here's html code:

<div class="form-group"> <label for="commenter-name" class="col-sm-3">name</label> <div class="col-sm-9"> <input type="text" class="form-control" name="commenter-name" id="commenter-name" placeholder="enter name" value="" > </div> </div> <div class="form-group"> <label for="commenter-comment" class="col-sm-3">comment</label> <div class="col-sm-9"> <textarea class="form-control" rows="3" name="commenter-comment" id="commenter-comment" placeholder="enter comment"></textarea> </div> </div> <div class="clear"></div> <div class="form-group custom-form"> <div class="col-sm-3"></div> <div class="col-sm-9"> <input id="submit-comment" type="button" class="btn btn-success" value="submit"> </div> </div>

here's js code (using jquery 1.8.3):

$("#submit-comment").click(function(event) { $.ajax({ type: "post", url: "_code/processpoll.php", data: { comment : comment, name : name, commenter_position : commenter_position } }) });

here's php code:

if ($_post["comment"]) { //log results of poll $log = new pollslogging($_post["name"], $_post["comment"], "comment", "comment", $_post["commenter_position"]); $log->writetofile(); }

this code worked 2+ years , behavior:

enter info in textbox fields , nail submit button the click event triggered , jquery ajax phone call made, not bring completion, success, or failure (i'm using debugger in chrome) then refresh page , getting status of 0 in error ajax (i don't have debugging in here, used figure out: error: function(jqxhr, textstatus, errorthrown) {alert(jqxhr.status)}

could have changed in different versions of major browsers stop working? blatantly missing something? read few things ajax phone call might never completing, i'm not sure how handle that... since haven't made code changes this... have few other little programs similar , have stopped working , behaving in similar way!

any help/guidance appreciated.

i'm sorry can't comment because of poor reputation, post answer.

actually, it's not possible provide answer, lack informations. don't see problem in code presented.

you're talking unusual behaviour, can describe ? did tried utilize tool firebug monitor request headers ?

php jquery ajax

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -