Я использую php/ajax для отправки формы без обновления страницы. Вот мои Files-jquery ajax request firebug error
coupon.js
jQuery(document).ready(function(){
jQuery(".appnitro").submit(function(e) {
$.ajax({
url : "http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street/sms.php",
type : "post",
dataType: "json",
data : $(this).serialize(),
success : function(data) {
for(var id in data) {
jQuery('#' + id).html(data[id]);
}
}
});
//return false or
e.preventDefault();
});
});
sms.php
<?php
//process form
$res = "Message successfully delivered";
$arr = array('mess' => $res);
echo json_encode($arr);//end sms processing
unset ($_POST);
?>
и вот код моей страницы HTML -
<form id="smsform" class="appnitro" action="http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street/sms.php" method="post">
...
</form>
<div id="mess" style="background:green;"></div>
Теперь, когда я нажимаю на кнопка отправки ничего не происходит, и на панели консоли отображается следующий заголовок -
POST http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street/sms.php
404 Not Found 1.29s `jquery.min.js (line 130)`
Response
Firebug needs to POST to the server to get this information for url:
http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street/sms.php
This second POST can interfere with some sites. If you want to send the POST again, open a new tab in Firefox, use URL 'about:config', set boolean value 'extensions.firebug.allowDoublePost' to true
This value is reset every time you restart Firefox This problem will disappear when https://bugzilla.mozilla.org/show_bug.cgi?id=430155 is shipped
Когда я установить «extensions.firebug.allowDoublePost» истинным, то следующие результаты показывают вверх -
POST http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street/sms.php
404 Not Found 1.29s `jquery.min.js (line 130)`
Response -
{"mess":"Message successfully delivered"}
кто может мне помочь в установлении этой Firebug ошибки 404 не найден. И почему он показывает jquery.min.js (line 130)
вдоль стороны?
P.S не -У беспокоиться о http://174.132.194.155/~kunal17/devbuzzr/wp-content/themes/street это моя базе URL
Невозможно найти sms.php. Таким образом, URL-адрес вашего JavaScript неправильный, находится ли он в той же папке, что и ваша HTML-страница с формой? –