Link to home
Start Free TrialLog in
Avatar of gen228
gen228

asked on

AJAX xmlhttpRequest call in Mozilla...

Hi, I would like to know if FireFox or Netscape 7.2 or any Mozilla browsers support Synchronous calls for the xmlHttpRequest method?  I am looking at this call:  

xmlHttpRequest.open( "GET", targetURL, false)

Any suggestions or comments are well appreciated!  If possible, can you please provide a simple example of it working in FireFox?  Thanks so much!

Thanks again,
G.
ASKER CERTIFIED SOLUTION
Avatar of rdcpro
rdcpro
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gen228
gen228

ASKER

Thank you for your response Mike !  I will test out this code and get right back to you!

Thanks again,
G.
Avatar of gen228

ASKER

Hi rdcpro, thanks again for you help.  I am a beginner about this xmlHttpRequest and ajax stuff, and I was wondering if you can answer these questions:

1. I understand AJAX is a technique where there is a javascript engine that takes care of some tasks while a request is being processed by the web server.  In this way, the user will not have to wait for the request to be processed b/c the JS engine will continue working for them.

2.  Is the XMLHttpRequest section of code the javascript engine?  

3.  Is the code I pasted below a good way to see AJAX in action(there is a javascript error), if not, is it possible you can provide a very simple example?

Thanks a greal deal for your great help!,
G.

<HTML>
<HEAD>
<script type='text/javascript'>
function include(lyr,url)
{
         var xml=new XMLHttpRequest();
         xml.open("GET",url,false);
         xml.send(null);
         document.getElementById(lyr).innerHTML=xml.responseText;
}
</script>
</HEAD>

<BODY>
      <a href="#" onClick="include('somediv','http://www.test228.com');return false">test</a>
      <div id="somediv">&nbsp;</div>
</BODY>
</HTML>
Avatar of gen228

ASKER

Hi rdcpro !  Thanks for your excellent help and responses!  

Thanks again,
G.