У меня не сложилось долгое время, я потерял несколько рефлексов.Запрос Ajax с jQuery не работает
Может кто-нибудь мне помочь?
Согласно Google Chrome, то ничего не происходит, когда я нажимаю отправить:
HTML
<form>
<label for="title">Title :</label>
<input type="text" id="title" />
<label for="comment">Comment :</label>
<input type="text" id="comment" />
<label for="project">Project :</label>
<input type="text" id="project" />
<input type="submit" value="Submit" />
</form>
JavaScript
$(function(){
$('form').submit(function(){
return false;
$.ajax({
type: 'POST',
url: 'http://support.foo.com/insert_bug.aspx',
data: 'username=mr%20dog&password=dog%3Ddog&short_desc=' + $('#title').val() + '&comment=' + $('#comment').val() + '&projectid=' + $('#project').val(),
success: function(msg){
alert(msg);
}
})
});
});
insert_bug.aspx
string username = Request["username"];
string password = Request["password"];
string short_desc = Request["short_desc"];
string comment = Request["comment"];
string projectid_string = Request["projectid"];
Если я отправлю URL-адрес из браузера, добавлена ошибка.
Ваша функция возвращает перед вызовом 'ajax' ... –
@JamesAllardice: Мой плохой': x' Спасибо! –