Json request with Javascript

Posted by chota on Stack Overflow See other posts from Stack Overflow or by chota
Published on 2011-01-05T19:49:28Z Indexed on 2011/01/05 19:53 UTC
Read the original article Hit count: 142

Filed under:
|
|

Hi, I am just beginner on java script and JSON and never had done any work in these before. My employer has just asked me to create the basic POC of these.
Scenario: I have a REST API and when i call it, it returns back response in JSON format.
Need to To: Create a HTML page and use javascript to call that REST API and capture JSON response and print in the same HTML page.

<script type="text/javascript">
    function loadMe() {
       loadJSON('http://myrestAPI');
   }
        function loadJSON(url) {
            //Help me here to capture the response and print in html page. 
         }
</script>

I would appreciate your help. This might be simple, but for me i have no idea because i never have done anything similar in java script and json. I goggled but could not find anything.

Thanks, chota

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about JSON