Nová ukázka
Reset
Načíst z URL
Uložit a získat odkaz
Vztahuje se k…
Nevyplňujte
Napiště „nejsem robot“
▶
Přepnout zobrazení
Výsledek
<input id="vyber" value="http://kod.djpw.cz/amkc-"> <a href="#" onclick="vyberClanek()">načti</a> <div id="mistoZobrazeni"></div>
HTML
Autoformát
Standardní režim
Mobilní zobrazení
#mistoZobrazeni { width: 500px; height: 400px; border: 1px solid red; overflow: auto; }
CSS
Autoformát
CSS reset
Až na konci
function vyberClanek() { var url = document.getElementById("vyber").value; if (url != 0) { if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { httpRequest = new XMLHttpRequest(); } httpRequest.open("GET", url, true); httpRequest.onreadystatechange = processRequest; httpRequest.send(null); } else { document.getElementById("mistoZobrazeni").innerHTML = ""; } } function processRequest() { if(httpRequest.readyState === XMLHttpRequest.DONE && httpRequest.status === 200) { document.getElementById("mistoZobrazeni").innerHTML = httpRequest.responseText; } }
J
ava
S
cript
Autoformát
jQuery
Umístění JS
window.onload
</head>
</body>