Advertisement
ErshKUS

js - search

Aug 4th, 2011
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. search.processResults = function() {
  2.   try {
  3.     if (this.request.readyState == 4) {
  4.       if (this.request.status == 200) {
  5.         osm.leftpan.content.innerHTML = this.request.responseText;
  6.       }
  7.     }
  8.   }
  9.   catch( e ) {
  10.       osm.leftpan.content.innerHTML = 'Ошибка: ' + e.description;
  11.   }
  12. };
  13.  
  14. search.search = function() {
  15.   this.request = new XMLHttpRequest();
  16.   //this.request.open('GET', 'http://nominatim.openstreetmap.org/search?q=test&format=json');
  17.   this.request.open('GET', 'http://10.0.6.90:8088/api/testjs.py');
  18.    
  19.   this.request.onreadystatechange = function(){search.processResults(this)};
  20.   this.request.send(null);
  21.   return false;
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement