jenniferG Posted August 29, 2007 Share Posted August 29, 2007 we are making a javascript ajax call with the below function We get an errors on page message which appear to come from the three commented lines that begin with "document". If we uncomment the alert line, the correct value is returned from the ajax call, etc. If comment out the alert line and uncomment any of the three lines that we would expect to set the fields in the form , then we get an error on page message. and the form controls are not uodated. Thanks, natalie--------------------------------------------------------------------------------------------- function getMSRP() { var CAMERAMODEL = getValue(); var myConn = new XHConn(); if (!myConn) {alert("XHConn creation failed.");} var showmsrp = function (XMLHTTPRequestObject) {var myresult=XMLHTTPRequestObject.responseText; //alert(myresult); //document.getElementById("MSRP").innerHTML= myresult; //document.getElementById("EXTPRICE").InnerHTML= //document.getElementById("QTY").innerHTML * document.getElementById ("MSRP").innerHTML; }; myConn.connect("returncameraprice.php", "POST" ,"CAMERAMODEL=" + CAMERAMODEL,showmsrp); } Quote Link to comment https://forums.phpfreaks.com/topic/67234-javascript-error/ Share on other sites More sharing options...
Adam Posted August 29, 2007 Share Posted August 29, 2007 not sure bout this, but when you use: var something = function() { ... } you can't pass a parameter can you? nor would you need to as it's within the function with the variable.. Quote Link to comment https://forums.phpfreaks.com/topic/67234-javascript-error/#findComment-337343 Share on other sites More sharing options...
jenniferG Posted August 29, 2007 Author Share Posted August 29, 2007 we have used function passing befre, and in fact, with the same XHCONN Ajax fremework. Thios afternoon, we changed innerHTML to value, so it read .....document.getElementById('control[).value = ...... and then evrything worked fine which os strange as we have other areas of oiur websirte where innerHTML works fine and,I had thought, was the preffered way to do this-- Strange....Strange Natalie Quote Link to comment https://forums.phpfreaks.com/topic/67234-javascript-error/#findComment-337390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.