dkizerian Posted June 11, 2008 Share Posted June 11, 2008 this is 2 lines from a piece of sample code I'm trying to disect. verify_level = this.req.responseXML.getElementsByTagName ("verifylevel")[0].firstChild.nodeValue; it throws an "Object Required" error. I'm just starting into this, and am a bit lost. Thanks - also, should this be in the AJAX section instead of here? here is the entire function, if it helps. business.processSearchResults = function(interaction) { var previous_verify_level = verify_level; var previous_moniker = current_moniker; verify_level = this.req.responseXML.getElementsByTagName ("verifylevel")[0].firstChild.nodeValue; if (interaction_verified == true){verify_level = "Verified";} // Check for a partial result with resolvable ranges (no picklist necessary) var j = 0; var i = 0; // if (verify_level == "PremisesPartial" || verify_level == "StreetPartial") // { // var tempresults = business.parsePicklistResults(this.req); // for (i=0;i<tempresults.length;i++) //{ //alert(tempresults[i].isUnresolvableRange() + "\n\ri =" + i + "\n\rj=" + j); // if (tempresults[i].isUnresolvableRange() == "False") {j++;} //} // if (j == tempresults.length) { verify_level = "Multiple"; } //} switch (verify_level) { case "PremisesPartial": var results = business.parsePicklistResults(this.req); // If the result is single, force an interaction if (results[0].isFullAddress().toLowerCase() == "true") { if (results.length == 1) { var sservice = new com.qas.SearchService( business.processForcedInteraction, business.processSearchError); sservice.refine(results[0].getMoniker(),""); return; } // Special case - proweb occasionally returns a verified address with ***This Code is addressed above with the single premise*** // more than one result?? This handles that situation. **this code would cause issues in specific refinement cases because the verify levels weren't changing //else if (previous_verify_level == verify_level) //{ // var sservice = new com.qas.SearchService( // business.processSearchResults, // business.processSearchError); // sservice.refine(results[0].getMoniker(),""); // return; //} } if (previous_verify_level == verify_level && results.length > 1) { interface.showPremPartialError(); return; } interface.showPremPartialResults(business.parsePicklistResults(this.req)); // Check for a refine error and display message current_moniker = results[0].getMoniker(); if (previous_moniker == current_moniker) { interface.showRefineError(); } break; case "StreetPartial": var results = business.parsePicklistResults(this.req); // If the result is single, force an interaction if (results.length == 1 && results[0].isFullAddress().toLowerCase() == "true") { var sservice = new com.qas.SearchService( business.processForcedInteraction, business.processSearchError); sservice.refine(results[0].getMoniker(),""); return; } if (previous_verify_level == verify_level && results.length > 1) { interface.showStreetPartialError(); return; } interface.showStreetPartialResults(business.parsePicklistResults(this.req)); break; case "Verified": is_verified = true; interface.showVerifiedResults(business.parseSingleResult(this.req)); interface.appendApt(business.parseSingleResult(this.req)); events.handleThirdPartyButtonClick(); interaction_verified = ""; break; case "InteractionRequired": interface.showInteractionResults(business.parseSingleResult(this.req)); break; case "Multiple": interface.showMultipleResults(business.parsePicklistResults(this.req)); break; case "None": if (com.qas.IGNORE_UNMATCHED_ADDRESSES.toLowerCase() == "true") { interface.showVerifiedResults(originaladdress); events.submitForm(); } else { interface.showNoResults(); } break; default : break; } } Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/ Share on other sites More sharing options...
hansford Posted June 11, 2008 Share Posted June 11, 2008 we're missing the line number error and the xml document Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/#findComment-563238 Share on other sites More sharing options...
dkizerian Posted June 11, 2008 Author Share Posted June 11, 2008 the line number is to this line verify_level = this.req.responseXML.getElementsByTagName Can't realy post the XML, if there is a connection problem with the xml, could that cause the error I'm seeing? Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/#findComment-563244 Share on other sites More sharing options...
dkizerian Posted June 11, 2008 Author Share Posted June 11, 2008 got this error in firefox Error: this.req.responseXML has no properties Source File: http://roku.sorensonvrs.com/qas/proweb.js Line: 431 Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/#findComment-563249 Share on other sites More sharing options...
hansford Posted June 11, 2008 Share Posted June 11, 2008 yeah. Make sure you have a good XMLHttpRequest and the readystate == 4 then check that -> this.req.responseXML.getElementsByTagName ("verifylevel")[0].firstChild.nodeValue; actually points to something Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/#findComment-563254 Share on other sites More sharing options...
dkizerian Posted June 11, 2008 Author Share Posted June 11, 2008 how do I "sure you have a good XMLHttpRequest and the readystate == 4" ? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/109755-help-with-javascript-call/#findComment-563255 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.