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:
parent
5f06a444ed
commit
d930718c8f
2 changed files with 19 additions and 17 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue