Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 3
There are 1 users currently browsing forums.
JavaScript Coding JavaScript allows rich, browser-based web-applications with interactivity and complex visual effects. For discussion on JavaScript, use this forum.

Reply
  #1  
Old 02-01-2008
Teenager
 
Join Date: May 2007
Posts: 109
Rep Power: 4
Mini is on a distinguished road
AJAX HTTP request doesn't work in IE.

Im currently working on a VERY simple AJAX-PHP chat, it works well, doesnt work in IE, but works in every other browser.

Why is that?

Im posting this here because I beleive this is a AJAX problem, not php.

Chat.php:
Code:
</style>
<body onload="ajaxFunction('get.php',1);">
<P id=labelr>
</P>
<HR>CHAT:<input id=nick> : <input id=chat> <a href="javascript:submitr();">Submit</a>
<script type="text/javascript">
function ajaxFunction(url,labelc)
{

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      if (labelc==1){
      document.getElementById('labelr').innerHTML=xmlHttp.responseText;
      }
      }
    }
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  setTimeout("ajaxFunction('get.php',1)",150);
  }
</script>
<script type="text/javascript">
function submitr()
{
ajaxFunction("put.php?nick="+document.getElementById('nick').value+"&chat="+document.getElementById('chat').value,0);

}
</script>
get.php:
Code:
get the chat and parses it.
put.php:
Code:
Adds to chat.
Online Version
^ This is whats not working in IE ^


Thanks if any1 helps me, if its a php problem please tell me and Ill make a new topic in php section.



~Mini

EDIT:


IN IE it works, you can view chat and submit chat, but when new chat comes in it doesnt get the new chat, you must reload the page manualy, why is this?

Last edited by Mini; 02-01-2008 at 10:59 AM. Reason: more information on problem.
Reply With Quote
  #2  
Old 02-01-2008
Calamitie's Avatar
I'm seriously a jerk.
 
Join Date: Feb 2005
Location: Moodles, UK
Posts: 2,450
Rep Power: 8
Calamitie will become famous soon enough
Re: AJAX HTTP request doesn't work in IE.

I have ajax issues in Internet Explorer too; it works for some stuff, but others it's as if it doesn't want to send the request.

Vitrone is partially missing features in IE at the moment thanks to the issue.

(You're not alone, but I can't help )
Reply With Quote
  #3  
Old 02-01-2008
Teenager
 
Join Date: May 2007
Posts: 109
Rep Power: 4
Mini is on a distinguished road
Re: AJAX HTTP request doesn't work in IE.

oh, well that stinks, just one more reason to hate IE i guess...
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an HTTP request in C++, and a question about Apstring libraries in DevCPP. vision C and C++ Programming 5 04-13-2007 07:43 AM
HTTP Authentication with PHP Mau PHP Articles 0 10-07-2006 09:11 PM
Getting Mouse Wheel and Side Buttons to Work in X.org/XFree _jameshales Articles, Tutorials, and Guides 0 01-01-2006 08:23 PM