Q:

How Load a PHP script into div Same Window in JQuery

I have error : data not define.
I'd like to refresh content into  from a php script who print html
My parent page :
<body>
variables ...
 <div id="comparateur2">
....
</div>

Javascript : 
<script type="application/javascript">
$(document).ready(function(){
$("form").submit(function(e){
var format = $("#format").val();
var qtephotos = $("#qtephotos").val();
var option1 = $('input[name=option1]:checked', '#formulaire').val();
var offre = $('input[name=offre]:checked', '#formulaire').val();    
var val = [];
    $(':checkbox:checked').each(function(i){
        val[i] = $(this).val();
    });
var dataString =  'format='+ format + '&qtephotos=' + qtephotos + '&option1=' + option1 + '&valoption=' + val; 
$.ajax ({
type: "POST",
url: "scripts/ajax_comparateur.php",
data: dataString,
success: function(){
        $('#comparateur2').html(data);
    }
});     
 });
});
</script>

Regards

A:

Your missing your dataType: and data parameter in the function()
without dataType anything returned will be ignored, and without data in the function anything returned will be unusable.
$.ajax ({
type: "POST",
url: "scripts/ajax_comparateur.php",
data: dataString,
dataType: "html",
success: function(data){
        $('#comparateur2').html(data);
    }
});   

