Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
What does this code do?

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Programmers Exchange
View previous topic :: View next topic  
Author Message
mc500
New one
New one


Joined: 05 Nov 2008
Posts: 1

PostPosted: Wed Nov 05, 2008 4:50 pm    Post subject: What does this code do? Reply with quote

Hi Everyone,

I wondered if anyone knew what the code below does and is it search engine frindly if included on a page?

Many thanks

Code:

=======================================================================
            ajax start
=======================================================================
*/
function makeHttpRequest(url, callback_function,param, return_xml)
{

   var http_request = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari,...
       http_request = new XMLHttpRequest();
       if (http_request.overrideMimeType) {
           http_request.overrideMimeType('text/xml');
       }
   } else if (window.ActiveXObject) { // IE
       try {
           http_request = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
           try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
           } catch (e) {}
       }
   }

   if (!http_request) {
       alert('You browser doesn\'t support this feature.');
       return false;
   }
   http_request.onreadystatechange = function() {
       if (http_request.readyState == 4) {
           if (http_request.status == 200) {
               if (return_xml) {
                   eval(callback_function + '(http_request.responseXML,param)');
               } else {
                   eval(callback_function + '(http_request.responseText,param)');
               }
           } else {
               alert('There was a problem with the request.(Code: ' + http_request.status + ')');
           }
       }
   }
  //  http_request.open('GET', url, true);
//    http_request.setRequestHeader('REFERER', document.location);
//    http_request.send(null);
//      alert('makeH');
   
     myRand=parseInt(Math.random()*99999999);
   http_request.open('GET', url+"&rand="+myRand, true);
   http_request.setRequestHeader('REFERER', document.location);
   http_request.setRequestHeader("Cache-Control", "no-cache");
   http_request.send(null);
   
   //alert('makeH');
}


/*
=======================================================================
            ajax end
=======================================================================

Back to top
View user's profile Send private message
vikas1234
Frequent Poster
Frequent Poster


Joined: 24 Aug 2008
Posts: 29

PostPosted: Fri Oct 01, 2010 4:19 pm    Post subject: Reply with quote

from where did you get this code ... my friend
_________________
Free Online Books|Free pdf Books |free AJAX Books
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Programmers Exchange All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert