简体   繁体   中英

Get JSON data from SSH server with url in Javascript/Jquery


I am trying to get all the data from my NOSQL Database which is on an SSH server and asign it to the variable text. I have a code snipped which is not working and i have no idear what i have to change because i am new to this. Thank you.

var text;

    //Request senden
    try {
        text = new XMLHttpRequest();
        text
                .open(
                        'URL is placed here'); //  
        asyncRequest.send(null);
    } catch (exception) {
        alert("Request to Database failed!!");
    }

how about using

$.get('url',null/object,function(data){
    ...get result into data here    
});

Much easier to use with jQuery here....is how to

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM