Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: httprequest
cpi
Junior Member

Posts: 2
Registered: 6/27/2006
Location: Spain
Member Is Offline
posted on 6/27/2006 at 08:37 AM Reply With Quote
httprequest


Quote:
<html>
<head>
<title>Untitled</title>
<link rel="stylesheet" href="../css/table.css">
<script language="JavaScript" src="../js/table.js"></script>
<script language="JavaScript" src="../js/template.js"></script>
<script language="JavaScript" src="../js/content.js"></script>
</head>
<script type="text/javascript">
var xmlhttp;

function loadXMLDoc(url,parm)
{
alert('antes de request');
self.status = "AJAX Enviando: " + url + " -.- " + parm
// code for Mozilla, etc.
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
xmlhttp.onreadystatechange=xmlhttpChange
xmlhttp.open("POST",url,true)
xmlhttp.send(parm)
}
// code for IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
url=url+ 'E';
xmlhttp.onreadystatechange=xmlhttpChange
xmlhttp.open("POST",url,true)
xmlhttp.send(parm)
}
}
}

function xmlhttpChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
{
// if "OK"
if (xmlhttp.status==200)
{
self.status = "AJAX Recibe: " + xmlhttp.responseText
d=document.getElementById("query");
datosTabla= xmlhttp.responseText;
}
else
{
self.status = "AJAX error."
alert("Error al recibir datos XML Ajax")
}
}
}

function SendAjaxData()
{
var wprm = "cwzpgm=QUERY2&cwztrn=%cw-cwztrn0%&demoname=David"
+ "&r4novale=novale"
loadXMLDoc("R4AJAX",wprm);
}

function cambiar(){
tabla.changeCont('TABLE_CONTENT',3);
}
</script>


<body>
<input type="button" name="req" value="req" title="Enviar Ajax"
onclick=" cambiar(); SendAjaxData();" />
<input type="button" name="cambiar" value="cambiar" onClick="cambiar()" />
<div id="query" style="border-width:thin; border-color:silver; border-style:groove;">
<SCRIPT LANGUAGE="JavaScript">
var tabla = new TTable(TABLE_CAPT, TABLE_CONTENT, TABLE_LOOK);
</SCRIPT>
</div>
</body>
</html>


Look like
Quote:
<input type="button" name="req" value="req" title="Enviar Ajax"
onclick=" cambiar(); SendAjaxData();" />


run OK, but

Quote:
<input type="button" name="req" value="req" title="Enviar Ajax"
onclick=" SendAjaxData(); cambiar(); " />


dont run. Error: TTPi is not defined in table.js (line 9).

MyTTP.changeCont dont works if xmlhttprequest is running before!!

Please help.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Simple
XP-styled
3D designed
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004