cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles with AJAX query in webscript

vladislavlysov
Champ in-the-making
Champ in-the-making
Hello!!!
    I wrote a web script that sends the AJAX request. Next code containig in file "test.get.js":

function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function startRequest(){
  var req = getXmlHttp();
  req.open("GET", "https://localhost:8443/solr/alfresco/afts?  q=TYPE:%22cm:content%22&wt=xml&facet=true&facet.field=TYPE&facet.sort=count", true);
  req.send(null);
}
 
startRequest();
But a got exception "Cannot find function open". He didn't find XMLHttpRequest. Why?
After that a read this page http://wiki.alfresco.com/wiki/AJAX_Support and change my code in accordance with YAHOO. But it doesn't work. How do I get Ajax request?
Thank you.
1 REPLY 1

vladislavlysov
Champ in-the-making
Champ in-the-making
Hello again!
    I found one solution for my problem. http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-w.... Bot now, where i do GET request for this address https://localhost:8443/solr/alfresco/afts?score&start=0&q=%28TYPE:%22cm:content%22+AND+%28cm:name:%2... to get all the documents found by a SOLR, but I have exception - " javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed". Is there some other way to get search results via webskripts?
Thank you.