‎05-06-2009 07:25 PM
hi im trying to use ajax to send and receive variables i saw this (http://forums.ni.com/ni/board/message?board.id=170&message.id=375263&requireLogin=False) example, and im trying to use similar code to send data to a shared variable that i created using LV8.6 but for same reason the data never reach the vi,i cant explain why if sameone can help i would apreciate, here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script language="JavaScript" type="text/javascript">
function getXMLHttpRequest() {
var request = false;
try {
request = new XMLHttpRequest();
}
catch(err1) {
try {
request = new ActiveXObject("Msxm12.XMLHTTP");
}
catch(err2) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(err3) {
request = false;
}
}
}
return request;
}
var request = new XMLHttpRequest();
function upload(name,value){
var upUrl = "http://localhost/filtrowebservice/" + name + "/" + value;
request.open("GET", upUrl, true);
request.send(null);
}
function responseAjax(){
alert(request.readyState);
alert(request.status);
alert(request.responseText);
var data = request.responseText;
document.getElementById("textout").innerHTML = data;
}
</script>
</head>
<body>
<form>
<input type="text" name="vin" value="" />
<input type="submit" value="submit" onclick="upload(name,value)"/>
</form>
<?php
?>
</body>
</html>
‎05-06-2009 10:53 PM
‎05-07-2009 03:52 AM
‎05-07-2009 08:34 AM
Are you able to post the VI as well? You've only given us half of the info we need...
If the ajax part isnt working, you may want to try a web development forum. 😉
‎05-07-2009 10:34 AM