![]() |
SimpleXML/Ajax/Internet Explorer problems - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: SimpleXML/Ajax/Internet Explorer problems (/showthread.php?tid=22141) |
SimpleXML/Ajax/Internet Explorer problems - El Forum - 08-30-2009 [eluser]MARKNEUBURGER[/eluser] Hi, I'm working on a web application that allows for a div to have its contents filled into automatically via a jQuery Ajax request. The contents of the div are a parsed XML file. I am doing the parsing with SimpleXML (not the CodeIgniter version, as I'm running PHP 5.2.9 and have access to it as part of my PHP installation). Everything works great in every browser except Internet Explorer (6, 7, and 8). Loading the exact same page, I get PHP errors from IE that do not appear in the other browsers, which function as expected. The first error occurs at the second of these two lines, in my XML parser function: Code: $dininghall_node_array = $menu->xpath("//dininghall[@name=\"".$dininghall."\"]"); The error is "Undefined offset: 0". If I insert a block of code like the following directly after these two lines: Code: if (isset($dininghall_node)) echo "Variable set!" ![]() Any thoughts? Thanks, Mark SimpleXML/Ajax/Internet Explorer problems - El Forum - 08-31-2009 [eluser]LuckyFella73[/eluser] You are right, server side code is basicly independent of the browsertype you are using. Your problem seems to be that the IEs don't send the needed value to your php code so you will have to check your ajax script. Please post your ajax function then I'm sure somebody aroud this forum is able to help you. SimpleXML/Ajax/Internet Explorer problems - El Forum - 08-31-2009 [eluser]n0xie[/eluser] Be wary of javascript in IE. Make sure the syntax is completely accurate. IE javascript parser is much less forgiving than Firefox or Opera, so one omitted ';','}' or ')' and your code will not run correctly. SimpleXML/Ajax/Internet Explorer problems - El Forum - 08-31-2009 [eluser]MARKNEUBURGER[/eluser] Spot on. Thanks much, it was indeed the javascript. For some reason, IE was appending an extra space to the variables i was posting. I never figured out why this was, but using trim() on the variables when they got to PHP solved the problem. |