1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +02:00

Fix dynamic page form submit when form action is javascript

This commit is contained in:
Afterster 2015-06-05 07:28:03 +02:00
parent 5f06a444ed
commit d930718c8f
2 changed files with 19 additions and 17 deletions

View file

@ -92,23 +92,25 @@ $(function() {
var postData = $(this).serializeArray();
var formURL = $(this).attr("action");
$.ajax(
{
url : formURL,
type: "POST",
data : postData,
success:function(data, status, jqXHR)
{
loadContentData(data, status, jqXHR);
window.location.hash = "";
},
error: function(jqXHR, status, errorThrown)
{
alert(errorThrown);
}
});
if (formURL.indexOf('javascript:') !== 0) {
$.ajax(
{
url : formURL,
type: "POST",
data : postData,
success:function(data, status, jqXHR)
{
loadContentData(data, status, jqXHR);
window.location.hash = "";
},
error: function(jqXHR, status, errorThrown)
{
alert(errorThrown);
}
});
e.preventDefault();
e.preventDefault();
}
}
});