AJAX page working in IE, not in any other browsers. HTTP request problem?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jtime
    New Member
    • Apr 2010
    • 2

    AJAX page working in IE, not in any other browsers. HTTP request problem?

    I recently inherited a page from a former coworker and am stuck with how to fix it. The webpage provides the user with a form that allows them to select from different criteria, and as the user selects different options the database dynamically returns and displays the number of matching records. Problem comes in that the page only works in IE within quirks mode, and the page won't display the number returned in any other browser (Firefox, Opera, Chrome, etc..).

    I believe the problem is occurring in the codeblock below:
    Code:
    var httpRequest;		
    function getHttpRequest(url) {
    if (typeof ActiveXObject != 'undefined') { 
    	httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } 
    else if (typeof XMLHttpRequest != 'undefined') { 
    	httpRequest = new XMLHttpRequest();  } 
    		
    if (httpRequest) {
    	httpRequest.open("GET", url, false); 
    	httpRequest.send(null); 
    	return httpRequest; } 
    else { 
    	return void 0; }
    }
    The website files this page calls on are all in the same directory on the same server. The page is able to correctly update the country and states and country fields in the drop down select boxes on the form, but it just won't display the matching records number in any of the other browsers. I thought maybe I should change it to be an asynchronous call, but I'm not sure if that is so or how exactly to do that with this scenario, as the other examples I've found didn't seem to fit what was occurring above.

    Any and all help is greatly appreciated!!!!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    any messages in the error console?

    Comment

    • jtime
      New Member
      • Apr 2010
      • 2

      #3
      The browsers themselves do not throw any error icons that typically show up when something serious is occurring. The only error the browser has thrown was when I tried changing it to an asynchronous call and an error occurred telling me the data wasn't ready yet. Using the validator plugin tools in Firefox, it just tells me that elsewhere on the page it doesn't like me using things such as vertical align top, etc.. but only a few of them, and it stated they weren't serious.

      Comment

      Working...