44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
function openPagePost(page, request, blank){
|
|
var blank = typeof blank !== 'undefined' ? blank : false;
|
|
var inputs = '';
|
|
request.forEach(function(element, index, array){
|
|
inputs += '<input type="hidden" name="'+element.name+'" value="'+element.value+'" />';
|
|
});
|
|
$('<form '+(blank?'target="_blank" ':"")+'method="POST" action="'+page+'">'+inputs+'</form>').appendTo("body").submit();
|
|
}
|
|
|
|
function bannerClick(banner, link){
|
|
$.ajax({url: "stats/bannerClick.php", method: "POST", data: { "banner": banner, "source": window.location.href }, dataType: "html" });
|
|
window.open(link);
|
|
}
|
|
|
|
function openRegistrationModal(){
|
|
$.ajax({
|
|
method:"POST",
|
|
url:'registration.php',
|
|
dataType:'html',
|
|
success: function(data){
|
|
$("#floating").html(data);
|
|
var off = $("#regButton").offset();
|
|
var right = $(document).width()-off.left - $("#regButton").outerWidth();
|
|
$("#floating").css("position","absolute").css("right",right).css("top",off.top+25);
|
|
$("#floating").show();
|
|
}
|
|
});
|
|
}
|
|
|
|
function sendRegistration(){
|
|
$.ajax({
|
|
method:'POST',
|
|
url:'sendRegistrationBackend.php',
|
|
dataType:'html',
|
|
data:$('#regForm').serialize(),
|
|
success: function(data){
|
|
// $("#regForm").remove();
|
|
$(".modalResponse").html(data);
|
|
/* Verificare se si possa eliminare la form in caso di registrazione avvenuta con successo assegnando un parametro
|
|
* allo span di avvenuta registrazione*/
|
|
// $(".modalError").html("");
|
|
}
|
|
});
|
|
}
|