prueba.html es donde creo la llamada.
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script type="text/javascript">
function llamarajax(idioma) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById('mostrar').innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","prueba2.html",true);
xmlhttp.send();
}
</script>
</head>
<body>
<input type="button" id="boton" name="boton" value="mostrar" onclick="llamarajax()" />
<div id="mostrar"></div>
</body>
</html>
prueba2.html es el que cargo mediente ajax
Código:
contenido ajax
<script type="text/javascript">alert("hola");</script>



