<?php { } ?>
ale nie wychodzi, jak mam to zrobić?
<?php { } ?>
[/php] ?> [php]
<html> <head> <script language=JavaScript type=text/JavaScript> function getNewHttpObject(){ if (typeof XMLHttpRequest != "undefined" ){return new XMLHttpRequest();} else if (window.ActiveXObject) { var aVersions=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp","Microsoft.XMLHttp"]; for (var i=0; i < aVersions.length; i++){ try{ var oXmlHttp=new ActiveXObject(aVersions[i]); return oXmlHttp; } catch (oError) { } } } throw new Error("Nie można utworzyć obiektu XMLHttp."); } //---------------------------------------- function podstaw(zrodlo,cel){ var nowy = getNewHttpObject(); nowy.open("POST", zrodlo); nowy.onreadystatechange = function() {if (nowy.readyState == 4) { if (nowy.status == 200) { document.getElementById(cel).innerHTML = nowy.responseText; } else { document.getElementById(cel).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message: " + theHttpRequest.statusText +"<\/p>"; } } }; nowy.send(false); } </SCRIPT> </head> <body> <a onclick="podstaw('napis.php','celbar');" >Załaduj </a> <br><br> <div id="celbar" >bleble </div> </body> </html>
<?php ?>