Как отлаживать Ajax звонит?Jquery

Программирование на jquery
Ответить
Anonymous
 Как отлаживать Ajax звонит?

Сообщение Anonymous »

У меня есть веб -приложение, которое отлично работает на VS 2013 на моем сервере разработки, но как только я опубликовал его на сервере R2 IIS 7.5 2008, сценариях AJAX, расположенные в моем пользовательском файле скрипта, больше не работайте, хотя другие сценарии jQuery, которые не вызывают Ajax, работают правильно. Есть ли что -нибудь еще, что нужно сделать, чтобы Ajax работал на сервере? Я прочитал несколько постов, но пока не смог найти ответ. Я ограничил опыт работы в IIS и Ajax.url: '/Home/GetRates', // URL for the request< /code>

Используя отладчик, который я обнаружил, что функция getRates () < /code> не была вызвана на удаленном сервере, хотя она находится на локальном (в разделе VS 2013) сервера разработки. Единственная разница, которую я вижу, - это путь, но не знаю, как его исправить.

ниже - сценарий Ajax: < /p>
// Retrieve rates and update partial view
$(function() {
$('#reservSearch').submit(function() {
if ($(this).valid()) {
$("#theModal").modal("show"); // Display the in progress.....
$.ajax({
url : '/Home/GetRates', // URL for the request
data : $("#reservSearch").serialize(), // the data to send (will be converted to a query string)
type : "POST", // whether this is a POST or GET request
dataType : 'html', // the type of data we expect back
success : function(data) { // code to run if the request succeeds; The response is passed to the function
$("#theModal").modal("hide"); // Close the in progress modal.....
$('#ratesView').html(data); // Fill div with results
},
error : function(xhr, status) { // code to run if the request fails; the raw request and status codes are passed to the function
$("#theModal").modal("hide"); // Close the in progress modal.....
alert('Error: Retrieving parking rates' + "" + xhr.error);
}
});
}
// it is important to return false in order to cancel the default submission of the form and perform the AJAX call
return false;
});
});
< /code>
Второе обновление < /h6>
После выполнения указаний в разделе комментариев это ответ от Ajax Call: < /p>

Server Error in Application "DEFAULT WEB SITE"

Internet Information Services 7.5



Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.



Detailed Error Information



Module
IIS Web Core


Notification
MapRequestHandler


Handler
StaticFile


Error Code
0x80070002





Requested URL
http://localhost:80/Home/GetRates


Physical Path
C:\inetpub\wwwroot\Home\GetRates


Logon Method
Anonymous


Logon User
Anonymous








Most likely causes:
  • The directory or file specified does not exist on the Web server.
  • The URL contains a typographical error.
  • A custom filter or module, such as URLScan, restricts access to the file.


Things you can try:
  • Create the content on the Web server.
  • Review the browser URL.
  • Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click
    here.


Links and More Information
This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
View more information »





Подробнее здесь: https://stackoverflow.com/questions/215 ... ajax-calls
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Jquery»