Bonjour,
je cherche un script en Ajax ou Jquery qui exécute plusieurs pages php au même temps.
j'ai trouver ce script mais c'est pas bien fonctionné :
<script>
/** Fonction AJAX traitant l'appel des fichiers **/
function file(fichier) {
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", fichier, true);
xhr_object.send(null);
if(xhr_object.readyState == 4)
return(xhr_object.responseText);
else
return(false);
}
</script>
<?php
$uri = "http://localhost/script/";
$script = array('script_1.php', 'script_2.php', 'script_3.php');
foreach($script as $value) {
$file_src = "";
$file_src = $uri.$value;
?>
<script>
file('<?php echo $file_src; ?>');
</script>
<?php
}
?>
merci pour votre aide