I have a javascript function provided by a sign manufacturer to set of GPI triggers. I tried to write a simple web form to submit POST requests to fire the javascript. I'm getting the "Error: Object Expected" from the following:
HTML Code:<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function fire(gpi_index) { method="POST"; url="http://localhost:8009/maxidrivers/maxisoftgpi/fire?gpi=" + gpi_index; async = false; if (window.ActiveXObject) { // MS IE try { var httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); httpRequest.Open(method, url, async); httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.Send(send); } catch (e) { return ("Error: " + url + "\n" + e); } } else if (window.XMLHttpRequest) { // Not MS IE try { var httpRequest = new XMLHttpRequest(); httpRequest.open(method, url, async); httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.send(send); } catch (e) { return("Error: " + url + "\n" + e); } } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Channel Changer</title> </head> <body> <form action="index.php"> <input type="button" value="1" onclick="fire()" /><br /> <input type="button" value="2" onclick="fire()" /><br /> <input type="button" value="5" onclick="fire()" /><br /> </form> </body> </html>



Reply With Quote




Bookmarks