micah1701 Posted July 7, 2006 Share Posted July 7, 2006 In the past I've used AJAX quite a bit to send and receive data. Mostly, I'm sending small bits of data using the GET method (?GET=adding_the_variables_to_the_url).I'm trying something new and want to send an entire form full of data, so I decided to use the POST method instead. I thought I had it working, as I have been using it for a couple days now in FireFox, however, I just realized it doesn't work in Internet Explorer.It returns the error "object doesn't support this property or method" for the line:[code]http.open("POST", "entryFormsubmit.php", true); [/code]Again, it works in FF and doesn't throw any erros in the Fire Fox JavaScript console.any idea what I'm missing? Let me know if you need to see more code.FYI...the http object (referrenced above that "doesn't support the property or method" is built like this:[code]function getHTTPObject() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } //end getHTTPObject() function to create XMLHttpRequest Objectvar http = getHTTPObject();[/code]Thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/13973-error-in-ie-when-using-post-method-in-ajax-script/ Share on other sites More sharing options...
cmgmyr Posted July 7, 2006 Share Posted July 7, 2006 try taking ", true" out and see what happensIf that doesn't work, try changing "post" back to "get" and see what heppens.-Chris Quote Link to comment https://forums.phpfreaks.com/topic/13973-error-in-ie-when-using-post-method-in-ajax-script/#findComment-54523 Share on other sites More sharing options...
micah1701 Posted July 7, 2006 Author Share Posted July 7, 2006 [quote]try taking ", true" out and see what happens[/quote]That solved it! thanks. I always thought the "true" was necessary though, so the script knew to wait for the readyState to change. But it works fine w/o it. eh, what do I know. Thats what I get for learning everything through online tutorials.Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/13973-error-in-ie-when-using-post-method-in-ajax-script/#findComment-54535 Share on other sites More sharing options...
cmgmyr Posted July 8, 2006 Share Posted July 8, 2006 hey, no problem, i'm glad it worked out for you.-Chris Quote Link to comment https://forums.phpfreaks.com/topic/13973-error-in-ie-when-using-post-method-in-ajax-script/#findComment-54681 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.