function getXMLHttpRequest-1 () {
function getXMLHttpRequest-2 () {
function getXMLHttpRequest-3 () {
var xhr = getXMLHttpRequest (); xhr.open ("get", "nom_du_fichier_a_executer.php", true); xhr.send (null);
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionfunction doAjax(filepath) { var xhr = new XMLHttpRequest(); xhr.open("GET", filepath, true); xhr.send(null); }
<td><?php echo JTEXT::_('GOOGLE_TRACKING_CODE'); ?></td> <td></td> ........ <td> " onclick="install_code (); set_spans_show('sp_number3','','sp_number4','next');" > </td>
<?php function verification { // Récupérons le code UA function onAfterRender() { $mainframe = &JFactory::getApplication(); $web_property_id = $this->params->get('web_property_id', ''); if($web_property_id '' || $mainframe->isAdmin() || strpos($_SERVER["PHP_SELF"], "index.php") false) { return; } // Maintenant, le script $buffer = JResponse::getBody(); $google_analytics_javascript = " <script type='text/javascript'> var _gaq = _gaq || []; _gaq.push(['_setAccount', '".$web_property_id."']); _gaq.push(['_trackPageview']); (function() { var ga document.createElement('script'); ga.type 'text/javascript'; ga.async = true; ga.src ('https:' document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script>"; // Insère le code UA sur chaque page du site $buffer = str_replace ("</head>", $google_analytics_javascript."</head>", $buffer); JResponse::setBody($buffer); return true; } } ?>
JavaScript : function install_code () { function XMLHttpRequest1() { var xhr = null; if (window.XMLHttpRequest || window.ActiveXObject) { if (window.ActiveXObject) { try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { xhr = new XMLHttpRequest(); } } else { alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest..."); return null; } return xhr; } var xhr = XMLHttpRequest1(); xhr.open("GET", "verification.php", true); xhr.send(null);
function install_code() { var xhr = XMLHttpRequest(); xhr.open("GET", "verification.php", true); xhr.send(null); }
xhr.onreadystatechange = mafonction;
function mafonction() { if (xhr.readyState == 4) { if (xhr.status == 200) { alert("SUCCEDED"); } else { alert("ERROR " + xhr.status); } }