custom popup i ajax
Er der nogle der kan give mig nogle hints til hvorfor dette ikke virker?<script>
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
$.ajax({
type: 'post',
url: 'load.php',
data: $('form').serialize(),
success: function CustomConfirm() {
this.render = function(){
var winW = window.innerWidth;
var winH = window.innerHeight;
var dialogoverlay = document.getElementById('dialogoverlay');
var dialogbox = document.getElementById('dialogbox');
dialogoverlay.style.display = "block";
dialogoverlay.style.height = winH+"px";
$('#dialogbox').center();
$(window).resize(function(){
$('#dialogbox').center();
});
dialogbox.style.display = "block";
document.getElementById('dialogboxhead').innerHTML = '<div style="text-align:right; padding:20px 20px 0px 0px;"><img onclick="Confirm.no()" src="/images/png/x-4x.png" style="height:20px" /></div><div><h2 style=" text-align:center;"><img src="/images/monkey.png" style="height:100px;"><br>Head</h2></div>';
document.getElementById('dialogboxbody').innerHTML = '<div style="text-align:center;">Content</div>';
document.getElementById('dialogboxfoot').innerHTML = '<div style="text-align:center;"><button onclick="Confirm.no()">Hit me again</button> <button onclick="Confirm.yes()">Yes, its awesome!</button><br></div>';
}
this.no = function(){
document.getElementById('dialogbox').style.display = "none";
document.getElementById('dialogoverlay').style.display = "none";
}
}
});
});
});
</script>