Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal, estou tendo problemas aqui com uma div que puxa um *.asp dentro dela... o problema é que dentro dessa asp que é carregada tenho que executar uma função que tmb esta dentro do meu ajax. alguem por favor poderia me ajudar ?
ajax_carrega_01.js
function AJAX(){
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
return xmlHttp;
}xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
return xmlHttp;
}xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;
}alert("Your browser does not support AJAX.");
return false;
}
}
}
}
function fetch_unix_timestamp()return parseInt(new Date().getTime().toString().substring(0, 10))
}
////////////////////////////////
//
// Refreshing the DIV TIMEDIV1
//
////////////////////////////////
function refreshdiv_timediv1(){
// Customise those settings
var divid = "timediv1";
var url = "carregado01.asp";
// Create xmlHttp
var xmlHttp_one = AJAX();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
// The code...
xmlHttp_one.onreadystatechange=function(){
if(xmlHttp_one.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp_one.responseText;
}
}
xmlHttp_one.open("GET",nocacheurl,true);
xmlHttp_one.send(null);
}
//testando comando de alert
function alert55()
{
alert ("Esta é uma caixa de diálogo ALERT do JavaScript!")
}
principal.asp
<html>
<title>titulo</title>
<head>
<script src="ajax_carrega_01.js"></script>
</head>
<body>
<script type="text/javascript">
refreshdiv_timediv1();
</script>
<div name="timediv1" id="timediv1" style="background-color: #cccccc;"></div>
</body>
</html>
[b]carregado01.asp[/b]
CARREGADOR 01
<%
response.write now()
%>
<script type="text/javascript">
alert55();
</script>
vale ressaltar que tmb tentei jogar nesse caregado01.asp o alert direto tmb nao pegou... assim:
<script type="text/javascript">
alert ("Esta é uma caixa de diálogo ALERT do JavaScript!")
</script>
Obrigada pela atenção pessoal! :rolleyes:
Carregando comentários...