Javascript getElementsByTagName not pulling correctly in IE8

WhereIsNealBush

New Member
I'm working out bugs that a coworker left on a page that posts a form to an API, and receives the XML response in an iframe, then parses through the children with XML. The page is working in IE9, Chrome, and Firefox, but not IE 8. the form:\[code\]<form action="../../includes/functions/ADapi.php" method="POST" target="response" id="addForm" ><fields galore></fields galore></form<iframe name="response" id="response" style="display:none;" ></iframe>\[/code\]the response:\[code\]<?xml version="1.0" encoding="utf-8" ?> - <xmlresponse> <DateTime>2012-04-26 15:36:47</DateTime> <confirmationcode>success</confirmationcode> </xmlresponse>\[/code\]the javascript:\[code\]function getResponse() { var myIFrame = document.getElementById("response"); var content = myIFrame.contentWindow.document.getElementsByTagName('confirmationcode'); var insertID = myIFrame.contentWindow.document.getElementsByTagName('id'); //var sql = myIFrame.contentWindow.document.getElementsByTagName('SQL'); var response = $(content).text(); var responseID = $(insertID).text(); //alert($(sql).text()); if(response == "Success" || response == 'success') { if(mode == 'edit') { post_to_url("/edit-contact", {type: 'edit', cust: id, mod: 'update',field : '<?php if(isset($_POST['field'])){ echo $_POST['field']; }?>',operator : '<?php if(isset($_POST['operator'])){ echo $_POST['operator']; }?>',criteria : '<?php if(isset($_POST['criteria'])){ echo $_POST['criteria']; }?>'}); } else { post_to_url("/edit-contact", {type: 'edit', cust: responseID, mod: 'insert',field : '<?php if(isset($_POST['field'])){ echo $_POST['field']; }?>',operator : '<?php if(isset($_POST['operator'])){ echo $_POST['operator']; }?>',criteria : '<?php if(isset($_POST['criteria'])){ echo $_POST['criteria']; }?>'}); } } else { alert("Error!"); } }\[/code\]each time it runs, it pops up the alert with 'Error!'Any help would be greatly appreciated.
 
Back
Top